fix overflow on negative bytes (#7070)

This commit is contained in:
David Matos
2022-11-10 22:33:15 +01:00
committed by GitHub
parent 18d7e64660
commit 312e9bf5d6
3 changed files with 33 additions and 5 deletions

View File

@ -74,3 +74,15 @@ fn into_filesize_filesize() {
assert!(actual.out.contains("3.0 KiB"));
}
#[test]
fn into_filesize_negative_filesize() {
let actual = nu!(
cwd: ".", pipeline(
r#"
-3kib | into filesize
"#
));
assert!(actual.out.contains("-3.0 KiB"));
}