From a1ecbf0a1a68ca7bb9f4e372e89b66ac3a945264 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 4 Jun 2019 20:42:15 +0530 Subject: Add support for static byte units --- tests/snapshots/success-bytes-bytes | 7 +++++++ tests/snapshots/success-bytes-gb | 7 +++++++ tests/snapshots/success-bytes-gib | 7 +++++++ tests/snapshots/success-bytes-mb | 7 +++++++ tests/snapshots/success-bytes-metric | 7 +++++++ tests/snapshots/success-bytes-mib | 7 +++++++ tests/snapshots/success-bytes-only | 7 ------- tests/stateless-journey.sh | 20 ++++++++------------ 8 files changed, 50 insertions(+), 19 deletions(-) create mode 100644 tests/snapshots/success-bytes-bytes create mode 100644 tests/snapshots/success-bytes-gb create mode 100644 tests/snapshots/success-bytes-gib create mode 100644 tests/snapshots/success-bytes-mb create mode 100644 tests/snapshots/success-bytes-metric create mode 100644 tests/snapshots/success-bytes-mib delete mode 100644 tests/snapshots/success-bytes-only (limited to 'tests') diff --git a/tests/snapshots/success-bytes-bytes b/tests/snapshots/success-bytes-bytes new file mode 100644 index 0000000..966bea6 --- /dev/null +++ b/tests/snapshots/success-bytes-bytes @@ -0,0 +1,7 @@ + 0 b b.empty + 123 b z123.b + 256 b a + 256 b c.lnk + 666 b .hidden.666 + 1258024 b dir + 1259325 b total \ No newline at end of file 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/snapshots/success-bytes-only b/tests/snapshots/success-bytes-only deleted file mode 100644 index 966bea6..0000000 --- a/tests/snapshots/success-bytes-only +++ /dev/null @@ -1,7 +0,0 @@ - 0 b b.empty - 123 b z123.b - 256 b a - 256 b c.lnk - 666 b .hidden.666 - 1258024 b dir - 1259325 b 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" -- cgit v1.2.3