nushell/crates/nu-command/tests/commands/def.rs
Fernando Herrera fdce6c49ab engine-q merge
2022-02-07 19:11:34 +00:00

26 lines
619 B
Rust

use nu_test_support::nu;
use nu_test_support::playground::Playground;
use std::fs;
<<<<<<< HEAD
=======
// FIXME: jt: needs more work
#[ignore]
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
#[test]
fn def_with_comment() {
Playground::setup("def_with_comment", |dirs, _| {
let data = r#"
#My echo
def e [arg] {echo $arg}
"#;
fs::write(dirs.root().join("def_test"), data).expect("Unable to write file");
let actual = nu!(
cwd: dirs.root(),
"source def_test; help e | to json"
);
assert!(actual.out.contains("My echo\\n\\n"));
});
}