Logs and tests (#3247)

* Add command name to err

* Add var name to error message

* Add test for def comment in test
This commit is contained in:
Leonhard Kipp
2021-04-02 00:09:33 +02:00
committed by GitHub
parent 0fe6c7c558
commit f03f1949bf
3 changed files with 27 additions and 2 deletions

View File

@ -0,0 +1,25 @@
use nu_test_support::fs::Stub::FileWithContent;
use nu_test_support::nu;
use nu_test_support::playground::Playground;
#[test]
fn defs_contain_comment_in_help() {
Playground::setup("comment_test", |dirs, sandbox| {
sandbox.with_files(vec![FileWithContent(
"my_def.nu",
r#"
# I comment and test. I am a good boy.
def comment_philosphy [] {
echo Its not a bug its an undocumented feature. (Anonymous)
}
"#,
)]);
let actual = nu!(cwd: dirs.test(), r#"
source my_def.nu
help comment_philosphy
"#);
assert!(actual.out.contains("I comment and test. I am a good boy."));
});
}