diff options
Diffstat (limited to 'test/test-common.sh')
-rwxr-xr-x[-rw-r--r--] | test/test-common.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test-common.sh b/test/test-common.sh index 7dd8128..da19490 100644..100755 --- a/test/test-common.sh +++ b/test/test-common.sh @@ -109,3 +109,11 @@ not() ( } ! eval "$@" ) + +# Plain command substitution would remove trailing whitespace, despite +# being significant when testing for newline-terminated lines. +equals() { + local stdin + IFS= read -rd '' stdin || : + [[ $1 == "$stdin" ]] +} |