More fixes for bigint duration (#3557)

This commit is contained in:
JT
2021-06-05 04:54:18 +12:00
committed by GitHub
parent 51890baace
commit 1d0d0425d4
4 changed files with 36 additions and 24 deletions

View File

@ -898,6 +898,31 @@ fn table_with_commas() {
assert_eq!(actual.out, "141");
}
#[test]
fn duration_overflow() {
let actual = nu!(
cwd: ".", pipeline(
r#"
ls | get modified | each { $it + 10000000000000000day }
"#)
);
assert!(actual.err.contains("Duration overflow"));
}
#[test]
fn date_and_duration_overflow() {
let actual = nu!(
cwd: ".", pipeline(
r#"
ls | get modified | each { $it + 1000000000day }
"#)
);
// assert_eq!(actual.err, "overflow");
assert!(actual.err.contains("Duration and date addition overflow"));
}
mod parse {
use nu_test_support::nu;