Blame tests/p_gzip/80-zmore-tests

iaind 56c8c8
#!/bin/bash
iaind 56c8c8
# Author: Iain Douglas <centos@1n6.org.uk>
iaind 56c8c8
iaind 56c8c8
t_Log "Running $0 Testing zmore"
iaind 56c8c8
iaind 56c8c8
# The zmore utility is just a wrapper round more which should be 
iaind 56c8c8
# tested as part of p_util-linux-ng. It does however deal with 
iaind 56c8c8
# multiple files for more so test that.
iaind 56c8c8
iaind 56c8c8
TESTFILE="./tests/p_gzip/gzip-test.txt.gz"
iaind 56c8c8
t_Log "Check single file invocation"
iaind 56c8c8
zmore $TESTFILE | grep -q -- '------> ./tests/p_gzip/gzip-test.txt.gz <-----'-
iaind 56c8c8
t_CheckExitStatus $?
iaind 56c8c8
iaind 56c8c8
# Check multifile invocation 
iaind 56c8c8
iaind 56c8c8
t_Log "Check multifile invocation"
iaind 56c8c8
iaind 56c8c8
expect << EOF &>/dev/null
iaind 56c8c8
spawn zmore $TESTFILE $TESTFILE
iaind 56c8c8
set timeout 2 
iaind 56c8c8
set match_max 1000
iaind 56c8c8
expect -- "--More--(Next file: ./tests/p_gzip/gzip-test.txt.gz)" {send n} timeout {exit 1 }
iaind 56c8c8
expect -- "gzip-test of single file" {exit 0} 
iaind 56c8c8
exit 1
iaind 56c8c8
EOF
iaind 56c8c8
iaind 56c8c8
t_CheckExitStatus $?
iaind 56c8c8
iaind 56c8c8