mirror of
https://github.com/casey/just.git
synced 2025-08-04 15:08:39 +00:00
Merge cf34244d2b
into 014491d667
This commit is contained in:
commit
54a2b678df
2 changed files with 34 additions and 0 deletions
10
src/item.rs
10
src/item.rs
|
@ -45,11 +45,21 @@ impl Display for Item<'_> {
|
|||
write!(f, " {relative}")
|
||||
}
|
||||
Self::Module {
|
||||
doc,
|
||||
groups,
|
||||
name,
|
||||
relative,
|
||||
optional,
|
||||
..
|
||||
} => {
|
||||
if let Some(docstr) = doc {
|
||||
writeln!(f, "# {docstr}")?;
|
||||
}
|
||||
|
||||
for group in groups.iter() {
|
||||
writeln!(f, "[group('{}')]", group)?;
|
||||
}
|
||||
|
||||
write!(f, "mod")?;
|
||||
|
||||
if *optional {
|
||||
|
|
|
@ -998,3 +998,27 @@ fn empty_doc_attribute_on_module() {
|
|||
.stdout("Available recipes:\n foo ...\n")
|
||||
.run();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn modules_with_attributes_are_dumped_correctly() {
|
||||
Test::new()
|
||||
.write("foo.just", "foo:\n @echo FOO")
|
||||
.justfile(
|
||||
"
|
||||
# doc
|
||||
[group('bar')]
|
||||
[group('baz')]
|
||||
mod foo
|
||||
",
|
||||
)
|
||||
.arg("--dump")
|
||||
.stdout(
|
||||
"
|
||||
# doc
|
||||
[group('bar')]
|
||||
[group('baz')]
|
||||
mod foo
|
||||
",
|
||||
)
|
||||
.run();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue