mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 11:45:50 +02:00
prevent panic with format command (#7522)
Related: #7211. Prevents numeric underflow in span. Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
This commit is contained in:
@ -42,6 +42,19 @@ fn can_use_variables() {
|
||||
assert_eq!(actual.out, "nu is a new type of shell");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn error_unmatched_brace() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats", pipeline(
|
||||
r#"
|
||||
open cargo_sample.toml
|
||||
| format "{$it.package.name"
|
||||
"#
|
||||
));
|
||||
|
||||
assert!(actual.err.contains("unmatched curly brace"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn format_filesize_works() {
|
||||
Playground::setup("format_filesize_test_1", |dirs, sandbox| {
|
||||
|
Reference in New Issue
Block a user