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