File: basic.sh

package info (click to toggle)
libzstd 1.5.7%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,348 kB
  • sloc: ansic: 89,030; sh: 3,788; python: 3,466; cpp: 2,927; makefile: 2,329; asm: 390
file content (36 lines) | stat: -rwxr-xr-x 1,052 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh

set -e

# Uncomment the set -v line for debugging
# set -v

# Test compression flags and check that they work
zstd file                 ; zstd -t file.zst
zstd -f file              ; zstd -t file.zst
zstd -f -z file           ; zstd -t file.zst
zstd -f -k file           ; zstd -t file.zst
zstd -f -C file           ; zstd -t file.zst
zstd -f --check file      ; zstd -t file.zst
zstd -f --no-check file   ; zstd -t file.zst
zstd -f -- file           ; zstd -t file.zst

# Test output file compression
zstd -o file-out.zst ; zstd -t file-out.zst
zstd -fo file-out.zst; zstd -t file-out.zst

# Test compression to stdout
zstd -c file       | zstd -t
zstd --stdout file | zstd -t
println bob | zstd | zstd -t

# Test keeping input file when compressing to stdout in gzip mode
if $(command -v $ZSTD_SYMLINK_DIR/gzip); then
    $ZSTD_SYMLINK_DIR/gzip -c file       | zstd -t ; test -f file
    $ZSTD_SYMLINK_DIR/gzip --stdout file | zstd -t ; test -f file
fi

# Test --rm
cp file file-rm
zstd --rm file-rm; zstd -t file-rm.zst
test ! -f file-rm