Skip to content

Commit

Permalink
Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
neunenak committed Jul 14, 2024
1 parent 58f25e8 commit e0cd52c
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions tests/modules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -810,3 +810,49 @@ fn comments_can_follow_modules() {
.stdout("FOO\n")
.run();
}

#[test]
fn doc_comment_on_module() {
Test::new()
.write("foo.just", "")
.justfile("
# Comment
mod foo
")
.test_round_trip(false)
.arg("--unstable")
.arg("--list")
.stdout("Available recipes:\n foo ... # Comment\n")
.run();
}

#[test]
fn doc_attribute_on_module() {
Test::new()
.write("foo.just", "")
.justfile(r#"
# Suppressed comment
[doc: "Comment"]
mod foo
"#)
.test_round_trip(false)
.arg("--unstable")
.arg("--list")
.stdout("Available recipes:\n foo ... # Comment\n")
.run();
}

#[test]
fn bad_module_attribute_fails() {
Test::new()
.write("foo.just", "")
.justfile(r#"
[no-cd]
mod foo
"#)
.test_round_trip(false)
.arg("--unstable")
.arg("--list")
.stdout("Available recipes:\n foo ... # Comment\n")
.run();
}

0 comments on commit e0cd52c

Please sign in to comment.