aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/functions/utilities.spec22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/functions/utilities.spec b/test/functions/utilities.spec
new file mode 100755
index 00000000..12501348
--- /dev/null
+++ b/test/functions/utilities.spec
@@ -0,0 +1,22 @@
+#!/usr/bin/env zsh
+#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8
+
+# Required for shunit2 to run correctly
+setopt shwordsplit
+SHUNIT_PARENT=$0
+
+function oneTimeSetUp() {
+ # Load Powerlevel9k
+ source functions/utilities.zsh
+}
+
+function testPrintSizeHumanReadableWithBigNumber() {
+ # Interesting: Currently we can't support numbers bigger than that.
+ assertEquals '0.87E' "$(printSizeHumanReadable 1000000000000000000)"
+}
+
+function testPrintSizeHumanReadableWithExabytesAsBase() {
+ assertEquals '9.77Z' "$(printSizeHumanReadable 10000 'E')"
+}
+
+source shunit2/source/2.1/src/shunit2