1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

Merge pull request #1285 from arsdragonfly/master

numfmt: add suffixes and fix negative numbers
This commit is contained in:
cnd 2018-09-05 10:39:26 +04:00 committed by GitHub
commit 35b1e47a63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 130 additions and 107 deletions

View file

@ -106,3 +106,17 @@ fn test_header_default() {
.run()
.stdout_is("header\n1000\n1100000\n100000000");
}
#[test]
fn test_negative() {
new_ucmd!()
.args(&["--from=si"])
.pipe_in("-1000\n-1.1M\n-0.1G")
.run()
.stdout_is("-1000\n-1100000\n-100000000");
new_ucmd!()
.args(&["--to=iec-i"])
.pipe_in("-1024\n-1153434\n-107374182")
.run()
.stdout_is("-1.0Ki\n-1.1Mi\n-102.4Mi");
}