bat-extras/test/suite/batwatch.sh

33 lines
612 B
Bash
Raw Normal View History

#!/bin/bash
2020-04-08 12:11:56 +02:00
setup() {
use_shim 'batwatch'
}
test:version() {
description "Test 'batwatch --version'"
snapshot stdout
snapshot stderr
2020-04-08 12:11:56 +02:00
2020-04-27 10:22:22 +02:00
batwatch --version | awk 'FNR <= 1 { print $1 }'
2020-04-08 12:11:56 +02:00
batwatch --version | awk 'p{print} /^$/ { p=1 }'
}
test:help() {
description "Test 'batwatch --help'"
snapshot stdout
batwatch --help
assert batwatch --help
batwatch --help | grep -q 'Usage'
}
test:watcher() {
description "Test 'batwatch <file>'"
fail "No longer fails silently due to incorrect flag to stat."
# Refactored to get here, but when it passes it will loop forever.
assert batwatch $0
}