forked from extern/nushell
handle duration overflow error (#2616)
* handle duration overflow error * handle checked_add_signed result
This commit is contained in:
committed by
GitHub
parent
973a8ee8f3
commit
2b076369e0
@@ -586,6 +586,31 @@ fn table_with_commas() {
|
||||
assert_eq!(actual.out, "141");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn duration_overflow() {
|
||||
let actual = nu!(
|
||||
cwd: ".", pipeline(
|
||||
r#"
|
||||
ls | get modified | = $it + 1000000000000000000yr
|
||||
"#)
|
||||
);
|
||||
|
||||
assert!(actual.err.contains("Duration overflow"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn date_and_duration_overflow() {
|
||||
let actual = nu!(
|
||||
cwd: ".", pipeline(
|
||||
r#"
|
||||
ls | get modified | = $it + 1000000yr
|
||||
"#)
|
||||
);
|
||||
|
||||
// assert_eq!(actual.err, "overflow");
|
||||
assert!(actual.err.contains("Duration and date addition overflow"));
|
||||
}
|
||||
|
||||
mod parse {
|
||||
use nu_test_support::nu;
|
||||
|
||||
|
Reference in New Issue
Block a user