950c5a483c5dc954c33bca02945c3da159522a06
[pcsx_rearmed.git] / deps / libchdr / deps / zstd-1.5.5 / tests / cli-tests / compression / basic.sh
1 #!/bin/sh
2
3 set -e
4
5 # Uncomment the set -v line for debugging
6 # set -v
7
8 # Test compression flags and check that they work
9 zstd file                 ; zstd -t file.zst
10 zstd -f file              ; zstd -t file.zst
11 zstd -f -z file           ; zstd -t file.zst
12 zstd -f -k file           ; zstd -t file.zst
13 zstd -f -C file           ; zstd -t file.zst
14 zstd -f --check file      ; zstd -t file.zst
15 zstd -f --no-check file   ; zstd -t file.zst
16 zstd -f -- file           ; zstd -t file.zst
17
18 # Test output file compression
19 zstd -o file-out.zst ; zstd -t file-out.zst
20 zstd -fo file-out.zst; zstd -t file-out.zst
21
22 # Test compression to stdout
23 zstd -c file       | zstd -t
24 zstd --stdout file | zstd -t
25 println bob | zstd | zstd -t
26
27 # Test keeping input file when compressing to stdout in gzip mode
28 if $(command -v $ZSTD_SYMLINK_DIR/gzip); then
29     $ZSTD_SYMLINK_DIR/gzip -c file       | zstd -t ; test -f file
30     $ZSTD_SYMLINK_DIR/gzip --stdout file | zstd -t ; test -f file
31 fi
32
33 # Test --rm
34 cp file file-rm
35 zstd --rm file-rm; zstd -t file-rm.zst
36 test ! -f file-rm