mirror of
https://github.com/eth-p/bat-extras.git
synced 2024-12-14 18:20:40 +01:00
57be774f88
- fix gnu stat formatting option from %z to %Z - use read with a one second timeout instead of sleep, then quit if user responds with "q" (for testing, mostly) - call pager_exec on entr and bat line instead of main so that --clear works
32 lines
618 B
Bash
32 lines
618 B
Bash
#!/bin/bash
|
|
|
|
setup() {
|
|
use_shim 'batwatch'
|
|
}
|
|
|
|
test:version() {
|
|
description "Test 'batwatch --version'"
|
|
snapshot stdout
|
|
snapshot stderr
|
|
|
|
batwatch --version | awk 'FNR <= 1 { print $1 }'
|
|
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:displayed() {
|
|
description "Test 'batwatch <file>': <file> should be displayed'"
|
|
snapshot stdout
|
|
|
|
batwatch --no-clear --watcher poll file.sh <<< "q"
|
|
batwatch --watcher poll file.sh <<< "q" | grep -q "Hello"
|
|
}
|