mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 06:30:08 +02:00
add unspanned
flag to error make, add tests (#6017)
* add `unspanned` flag to error make, add tests * fmt
This commit is contained in:
26
crates/nu-command/tests/commands/error_make.rs
Normal file
26
crates/nu-command/tests/commands/error_make.rs
Normal file
@ -0,0 +1,26 @@
|
||||
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"));
|
||||
}
|
@ -15,6 +15,7 @@ mod each;
|
||||
mod echo;
|
||||
mod empty;
|
||||
mod enter;
|
||||
mod error_make;
|
||||
mod every;
|
||||
mod find;
|
||||
mod first;
|
||||
|
Reference in New Issue
Block a user