mirror of
https://github.com/nushell/nushell
synced 2024-12-29 14:33:13 +00:00
a54f9719e5
* add `unspanned` flag to error make, add tests * fmt
26 lines
513 B
Rust
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"));
|
|
}
|