nushell/crates/nu-command/tests/commands/error_make.rs
pwygab a54f9719e5
add unspanned flag to error make, add tests (#6017)
* add `unspanned` flag to error make, add tests

* fmt
2022-07-12 06:03:50 -05:00

26 lines
513 B
Rust

use nu_test_support::{nu, pipeline};
#[test]
fn error_label_works() {
let actual = nu!(
cwd: ".", pipeline(
r#"
error make {msg:foo label:{text:unseen}}
"#
));
assert!(actual.err.contains("unseen"));
assert!(actual.err.contains("╰──"));
}
#[test]
fn no_span_if_unspanned() {
let actual = nu!(
cwd: ".", pipeline(
r#"
error make -u {msg:foo label:{text:unseen}}
"#
));
assert!(!actual.err.contains("unseen"));
}