summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSebastian Thiel <sthiel@thoughtworks.com>2019-06-04 20:42:15 +0530
committerSebastian Thiel <sthiel@thoughtworks.com>2019-06-04 20:42:15 +0530
commita1ecbf0a1a68ca7bb9f4e372e89b66ac3a945264 (patch)
treec1ca24667caa36da2c577335cc7293f19249c930 /tests
parent9d430a23d950edabfbeca55ba4805c48dfde99a3 (diff)
Add support for static byte units
Diffstat (limited to 'tests')
-rw-r--r--tests/snapshots/success-bytes-bytes (renamed from tests/snapshots/success-bytes-only)0
-rw-r--r--tests/snapshots/success-bytes-gb7
-rw-r--r--tests/snapshots/success-bytes-gib7
-rw-r--r--tests/snapshots/success-bytes-mb7
-rw-r--r--tests/snapshots/success-bytes-metric7
-rw-r--r--tests/snapshots/success-bytes-mib7
-rwxr-xr-xtests/stateless-journey.sh20
7 files changed, 43 insertions, 12 deletions
diff --git a/tests/snapshots/success-bytes-only b/tests/snapshots/success-bytes-bytes
index 966bea6..966bea6 100644
--- a/tests/snapshots/success-bytes-only
+++ b/tests/snapshots/success-bytes-bytes
diff --git a/tests/snapshots/success-bytes-gb b/tests/snapshots/success-bytes-gb
new file mode 100644
index 0000000..1951c1d
--- /dev/null
+++ b/tests/snapshots/success-bytes-gb
@@ -0,0 +1,7 @@
+ 0.00 GB b.empty
+ 0.00 GB z123.b
+ 0.00 GB a
+ 0.00 GB c.lnk
+ 0.00 GB .hidden.666
+ 0.00 GB dir
+ 0.00 GB total \ No newline at end of file
diff --git a/tests/snapshots/success-bytes-gib b/tests/snapshots/success-bytes-gib
new file mode 100644
index 0000000..ec4df62
--- /dev/null
+++ b/tests/snapshots/success-bytes-gib
@@ -0,0 +1,7 @@
+ 0.00 GiB b.empty
+ 0.00 GiB z123.b
+ 0.00 GiB a
+ 0.00 GiB c.lnk
+ 0.00 GiB .hidden.666
+ 0.00 GiB dir
+ 0.00 GiB total \ No newline at end of file
diff --git a/tests/snapshots/success-bytes-mb b/tests/snapshots/success-bytes-mb
new file mode 100644
index 0000000..d5e80e7
--- /dev/null
+++ b/tests/snapshots/success-bytes-mb
@@ -0,0 +1,7 @@
+ 0.00 MB b.empty
+ 0.00 MB z123.b
+ 0.00 MB a
+ 0.00 MB c.lnk
+ 0.00 MB .hidden.666
+ 1.26 MB dir
+ 1.26 MB total \ No newline at end of file
diff --git a/tests/snapshots/success-bytes-metric b/tests/snapshots/success-bytes-metric
new file mode 100644
index 0000000..400782c
--- /dev/null
+++ b/tests/snapshots/success-bytes-metric
@@ -0,0 +1,7 @@
+ 0.00 B b.empty
+ 123.00 B z123.b
+ 256.00 B a
+ 256.00 B c.lnk
+ 666.00 B .hidden.666
+ 1.26 MB dir
+ 1.26 MB total \ No newline at end of file
diff --git a/tests/snapshots/success-bytes-mib b/tests/snapshots/success-bytes-mib
new file mode 100644
index 0000000..ba23b87
--- /dev/null
+++ b/tests/snapshots/success-bytes-mib
@@ -0,0 +1,7 @@
+ 0.00 MiB b.empty
+ 0.00 MiB z123.b
+ 0.00 MiB a
+ 0.00 MiB c.lnk
+ 0.00 MiB .hidden.666
+ 1.20 MiB dir
+ 1.20 MiB total \ No newline at end of file
diff --git a/tests/stateless-journey.sh b/tests/stateless-journey.sh
index e5e39b2..c5a11bd 100755
--- a/tests/stateless-journey.sh
+++ b/tests/stateless-journey.sh
@@ -82,18 +82,14 @@ WITH_FAILURE=1
)
(with "the byte format set"
- (with "human-binary"
- it "produces a human-readable aggregate of the current directory, without total" && {
- WITH_SNAPSHOT="$snapshot/success-bytes-binary" \
- expect_run ${SUCCESSFULLY} "$exe" --format binary
- }
- )
- (with "bytes"
- it "produces a human-readable aggregate of the current directory, without total" && {
- WITH_SNAPSHOT="$snapshot/success-bytes-only" \
- expect_run ${SUCCESSFULLY} "$exe" --format bytes
- }
- )
+ for format in binary bytes metric gb gib mb mib; do
+ (with $format
+ it "produces a human-readable aggregate of the current directory, without total" && {
+ WITH_SNAPSHOT="$snapshot/success-bytes-$format" \
+ expect_run ${SUCCESSFULLY} "$exe" --format $format
+ }
+ )
+ done
)
)
(with "interactive mode"