1
0
mirror of https://github.com/octoleo/hosts.git synced 2024-11-21 12:25:14 +00:00

Use portable [[:digit:]] in version tests.

`\d` is not portable so use `[[:digit]]`.
This commit is contained in:
William Melody 2019-11-21 19:26:49 -08:00
parent e10d116510
commit 2db235f68b

View File

@ -10,7 +10,7 @@ load test_helper
@test "\`hosts version\` prints a version number." {
run "${_HOSTS}" version
printf "'%s'" "${output}"
echo "${output}" | grep -q '\d\+\.\d\+\.\d\+'
echo "${output}" | grep -q '[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+'
}
@test "\`hosts --version\` returns with 0 status." {
@ -21,7 +21,7 @@ load test_helper
@test "\`hosts --version\` prints a version number." {
run "${_HOSTS}" --version
printf "'%s'" "${output}"
echo "${output}" | grep -q '\d\+\.\d\+\.\d\+'
echo "${output}" | grep -q '[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+'
}
# help ########################################################################