summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/zstd/tests/cli-tests/basic
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/zstd/tests/cli-tests/basic')
-rwxr-xr-x3rdparty/zstd/tests/cli-tests/basic/help.sh10
-rw-r--r--3rdparty/zstd/tests/cli-tests/basic/help.sh.stdout.glob34
-rwxr-xr-x3rdparty/zstd/tests/cli-tests/basic/memlimit.sh40
-rw-r--r--3rdparty/zstd/tests/cli-tests/basic/memlimit.sh.stderr.exact13
-rw-r--r--3rdparty/zstd/tests/cli-tests/basic/memlimit.sh.stdout.exact13
-rwxr-xr-x3rdparty/zstd/tests/cli-tests/basic/output_dir.sh7
-rw-r--r--3rdparty/zstd/tests/cli-tests/basic/output_dir.sh.stderr.exact2
-rw-r--r--3rdparty/zstd/tests/cli-tests/basic/output_dir.sh.stdout.exact2
-rwxr-xr-x3rdparty/zstd/tests/cli-tests/basic/version.sh6
-rw-r--r--3rdparty/zstd/tests/cli-tests/basic/version.sh.stdout.glob2
10 files changed, 129 insertions, 0 deletions
diff --git a/3rdparty/zstd/tests/cli-tests/basic/help.sh b/3rdparty/zstd/tests/cli-tests/basic/help.sh
new file mode 100755
index 00000000000..927c3ffbcc5
--- /dev/null
+++ b/3rdparty/zstd/tests/cli-tests/basic/help.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -e
+
+println "+ zstd -h"
+zstd -h
+println "+ zstd -H"
+zstd -H
+println "+ zstd --help"
+zstd --help
diff --git a/3rdparty/zstd/tests/cli-tests/basic/help.sh.stdout.glob b/3rdparty/zstd/tests/cli-tests/basic/help.sh.stdout.glob
new file mode 100644
index 00000000000..21bc28c3fa8
--- /dev/null
+++ b/3rdparty/zstd/tests/cli-tests/basic/help.sh.stdout.glob
@@ -0,0 +1,34 @@
++ zstd -h
+Compress or decompress the INPUT file(s); reads from STDIN if INPUT is `-` or not provided.
+
+Usage: zstd *OPTIONS...* *INPUT... | -* *-o OUTPUT*
+
+Options:
+ -o OUTPUT Write output to a single file, OUTPUT.
+ -k, --keep Preserve INPUT file(s). *Default*
+ --rm Remove INPUT file(s) after successful (de)compression.
+
+ -# Desired compression level, where `#` is a number between 1 and 19;
+ lower numbers provide faster compression, higher numbers yield
+ better compression ratios. *Default: 3*
+
+ -d, --decompress Perform decompression.
+ -D DICT Use DICT as the dictionary for compression or decompression.
+
+ -f, --force Disable input and output checks. Allows overwriting existing files,
+ receiving input from the console, printing output to STDOUT, and
+ operating on links, block devices, etc. Unrecognized formats will be
+ passed-through through as-is.
+
+ -h Display short usage and exit.
+ -H, --help Display full help and exit.
+ -V, --version Display the program version and exit.
+
++ zstd -H
+...
+Advanced options:
+...
++ zstd --help
+...
+Advanced options:
+...
diff --git a/3rdparty/zstd/tests/cli-tests/basic/memlimit.sh b/3rdparty/zstd/tests/cli-tests/basic/memlimit.sh
new file mode 100755
index 00000000000..88d734d0d9d
--- /dev/null
+++ b/3rdparty/zstd/tests/cli-tests/basic/memlimit.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+echo "some data" > file
+
+println "+ zstd --memory=32LB file"
+zstd --memory=32LB file && die "Should not allow bogus suffix"
+println "+ zstd --memory=32LiB file"
+zstd --memory=32LiB file && die "Should not allow bogus suffix"
+println "+ zstd --memory=32A file"
+zstd --memory=32A file && die "Should not allow bogus suffix"
+println "+ zstd --memory=32r82347dn83 file"
+zstd --memory=32r82347dn83 file && die "Should not allow bogus suffix"
+println "+ zstd --memory=32asbdf file"
+zstd --memory=32asbdf file && die "Should not allow bogus suffix"
+println "+ zstd --memory=hello file"
+zstd --memory=hello file && die "Should not allow non-numeric parameter"
+println "+ zstd --memory=1 file"
+zstd -q --memory=1 file && die "Should allow numeric parameter without suffix"
+rm file.zst
+println "+ zstd --memory=1K file"
+zstd -q --memory=1K file && die "Should allow numeric parameter with expected suffix"
+rm file.zst
+println "+ zstd --memory=1KB file"
+zstd -q --memory=1KB file && die "Should allow numeric parameter with expected suffix"
+rm file.zst
+println "+ zstd --memory=1KiB file"
+zstd -q --memory=1KiB file && die "Should allow numeric parameter with expected suffix"
+rm file.zst
+println "+ zstd --memory=1M file"
+zstd -q --memory=1M file && die "Should allow numeric parameter with expected suffix"
+rm file.zst
+println "+ zstd --memory=1MB file"
+zstd -q --memory=1MB file && die "Should allow numeric parameter with expected suffix"
+rm file.zst
+println "+ zstd --memory=1MiB file"
+zstd -q --memory=1MiB file && die "Should allow numeric parameter with expected suffix"
+rm file.zst
+
+rm file
+exit 0
diff --git a/3rdparty/zstd/tests/cli-tests/basic/memlimit.sh.stderr.exact b/3rdparty/zstd/tests/cli-tests/basic/memlimit.sh.stderr.exact
new file mode 100644
index 00000000000..3785b0f92f3
--- /dev/null
+++ b/3rdparty/zstd/tests/cli-tests/basic/memlimit.sh.stderr.exact
@@ -0,0 +1,13 @@
+error: only numeric values with optional suffixes K, KB, KiB, M, MB, MiB are allowed
+error: only numeric values with optional suffixes K, KB, KiB, M, MB, MiB are allowed
+error: only numeric values with optional suffixes K, KB, KiB, M, MB, MiB are allowed
+error: only numeric values with optional suffixes K, KB, KiB, M, MB, MiB are allowed
+error: only numeric values with optional suffixes K, KB, KiB, M, MB, MiB are allowed
+error: only numeric values with optional suffixes K, KB, KiB, M, MB, MiB are allowed
+Should allow numeric parameter without suffix
+Should allow numeric parameter with expected suffix
+Should allow numeric parameter with expected suffix
+Should allow numeric parameter with expected suffix
+Should allow numeric parameter with expected suffix
+Should allow numeric parameter with expected suffix
+Should allow numeric parameter with expected suffix
diff --git a/3rdparty/zstd/tests/cli-tests/basic/memlimit.sh.stdout.exact b/3rdparty/zstd/tests/cli-tests/basic/memlimit.sh.stdout.exact
new file mode 100644
index 00000000000..1821648e406
--- /dev/null
+++ b/3rdparty/zstd/tests/cli-tests/basic/memlimit.sh.stdout.exact
@@ -0,0 +1,13 @@
++ zstd --memory=32LB file
++ zstd --memory=32LiB file
++ zstd --memory=32A file
++ zstd --memory=32r82347dn83 file
++ zstd --memory=32asbdf file
++ zstd --memory=hello file
++ zstd --memory=1 file
++ zstd --memory=1K file
++ zstd --memory=1KB file
++ zstd --memory=1KiB file
++ zstd --memory=1M file
++ zstd --memory=1MB file
++ zstd --memory=1MiB file
diff --git a/3rdparty/zstd/tests/cli-tests/basic/output_dir.sh b/3rdparty/zstd/tests/cli-tests/basic/output_dir.sh
new file mode 100755
index 00000000000..a8819d29260
--- /dev/null
+++ b/3rdparty/zstd/tests/cli-tests/basic/output_dir.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+println "+ zstd -r * --output-dir-mirror=\"\""
+zstd -r * --output-dir-mirror="" && die "Should not allow empty output dir!"
+println "+ zstd -r * --output-dir-flat=\"\""
+zstd -r * --output-dir-flat="" && die "Should not allow empty output dir!"
+exit 0
diff --git a/3rdparty/zstd/tests/cli-tests/basic/output_dir.sh.stderr.exact b/3rdparty/zstd/tests/cli-tests/basic/output_dir.sh.stderr.exact
new file mode 100644
index 00000000000..e12b50427cf
--- /dev/null
+++ b/3rdparty/zstd/tests/cli-tests/basic/output_dir.sh.stderr.exact
@@ -0,0 +1,2 @@
+error: output dir cannot be empty string (did you mean to pass '.' instead?)
+error: output dir cannot be empty string (did you mean to pass '.' instead?)
diff --git a/3rdparty/zstd/tests/cli-tests/basic/output_dir.sh.stdout.exact b/3rdparty/zstd/tests/cli-tests/basic/output_dir.sh.stdout.exact
new file mode 100644
index 00000000000..1e478cd7531
--- /dev/null
+++ b/3rdparty/zstd/tests/cli-tests/basic/output_dir.sh.stdout.exact
@@ -0,0 +1,2 @@
++ zstd -r * --output-dir-mirror=""
++ zstd -r * --output-dir-flat=""
diff --git a/3rdparty/zstd/tests/cli-tests/basic/version.sh b/3rdparty/zstd/tests/cli-tests/basic/version.sh
new file mode 100755
index 00000000000..f75eaa84fb4
--- /dev/null
+++ b/3rdparty/zstd/tests/cli-tests/basic/version.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+set -e
+
+zstd -V
+zstd --version
diff --git a/3rdparty/zstd/tests/cli-tests/basic/version.sh.stdout.glob b/3rdparty/zstd/tests/cli-tests/basic/version.sh.stdout.glob
new file mode 100644
index 00000000000..4cc9fb9b234
--- /dev/null
+++ b/3rdparty/zstd/tests/cli-tests/basic/version.sh.stdout.glob
@@ -0,0 +1,2 @@
+*** Zstandard CLI (*-bit) v1.*.*, by Yann Collet ***
+*** Zstandard CLI (*-bit) v1.*.*, by Yann Collet ***