From 4a44d7bbc68ff3e363e6c166a588474cbd6c20f8 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 3 Oct 2014 13:35:14 +0200 Subject: ui: Recognize the same size units as Coreutils. * guix/ui.scm (size->number): Add a bunch of large units. Recognize one-letter unit names. Change "KB" to "kB". * tests/ui.scm ("size->number, 1T"): New test. * doc/guix.texi (Invoking guix gc): Add cross-reference to "Block size" in the Coreutils manual. (Invoking guix system): Likewise. --- tests/ui.scm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests') diff --git a/tests/ui.scm b/tests/ui.scm index 7cc02649e1..db90cdd479 100644 --- a/tests/ui.scm +++ b/tests/ui.scm @@ -189,6 +189,10 @@ Second line" 24)) (inexact->exact (round (* 1.2 (expt 2 30)))) (size->number "1.2GiB")) +(test-equal "size->number, 1T" + (expt 2 40) + (size->number "1T")) + (test-assert "size->number, invalid unit" (catch 'quit (lambda () -- cgit v1.2.3