diff options
| author | Eric Bavier <bavier@member.fsf.org> | 2020-09-25 11:00:11 -0500 |
|---|---|---|
| committer | Eric Bavier <bavier@member.fsf.org> | 2020-09-28 21:06:36 -0500 |
| commit | d8934360d2453a403b5433e71d09188e4ed23b57 (patch) | |
| tree | 8f65be24496c1cc375bc675ca20e7d126f8d2ed1 /tests/guix-lint.sh | |
| parent | 9380b0a0752d7b922a664e6d96899047cb2f2811 (diff) | |
tests: Simplify shell exit status negation;
* tests/guix-archive.sh, tests/guix-build-branch.sh, tests/guix-build.sh,
tests/guix-daemon.sh, tests/guix-download.sh, tests/guix-environment.sh,
tests/guix-gc.sh, tests/guix-git-authenticate.sh, tests/guix-graph.sh,
tests/guix-hash.sh, tests/guix-lint.sh, tests/guix-pack-relocatable.sh,
tests/guix-pack.sh, tests/guix-package-aliases.sh, tests/guix-package-net.sh,
tests/guix-package.sh: Use the shell '!' keyword to negate command exit status
in place of 'if ...; then false; else true; fi'
Diffstat (limited to 'tests/guix-lint.sh')
| -rw-r--r-- | tests/guix-lint.sh | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/tests/guix-lint.sh b/tests/guix-lint.sh index ebe79efb84b..fdf548fbf18 100644 --- a/tests/guix-lint.sh +++ b/tests/guix-lint.sh | |||
| @@ -58,24 +58,19 @@ grep_warning () | |||
| 58 | # 3) the description has a single space following the end-of-sentence period. | 58 | # 3) the description has a single space following the end-of-sentence period. |
| 59 | 59 | ||
| 60 | out=`guix lint -c synopsis,description dummy 2>&1` | 60 | out=`guix lint -c synopsis,description dummy 2>&1` |
| 61 | if [ `grep_warning "$out"` -ne 3 ] | 61 | test `grep_warning "$out"` -eq 3 |
| 62 | then false; else true; fi | ||
| 63 | 62 | ||
| 64 | out=`guix lint -c synopsis dummy 2>&1` | 63 | out=`guix lint -c synopsis dummy 2>&1` |
| 65 | if [ `grep_warning "$out"` -ne 2 ] | 64 | test `grep_warning "$out"` -eq 2 |
| 66 | then false; else true; fi | ||
| 67 | 65 | ||
| 68 | out=`guix lint -c description dummy 2>&1` | 66 | out=`guix lint -c description dummy 2>&1` |
| 69 | if [ `grep_warning "$out"` -ne 1 ] | 67 | test `grep_warning "$out"` -eq 1 |
| 70 | then false; else true; fi | ||
| 71 | 68 | ||
| 72 | out=`guix lint -c description,synopsis dummy 2>&1` | 69 | out=`guix lint -c description,synopsis dummy 2>&1` |
| 73 | if [ `grep_warning "$out"` -ne 3 ] | 70 | test `grep_warning "$out"` -eq 3 |
| 74 | then false; else true; fi | ||
| 75 | 71 | ||
| 76 | if guix lint -c synopsis,invalid-checker dummy 2>&1 | \ | 72 | guix lint -c synopsis,invalid-checker dummy 2>&1 | \ |
| 77 | grep -q 'invalid-checker: invalid checker' | 73 | grep -q 'invalid-checker: invalid checker' |
| 78 | then true; else false; fi | ||
| 79 | 74 | ||
| 80 | # Make sure specifying multiple packages works. | 75 | # Make sure specifying multiple packages works. |
| 81 | guix lint -c inputs-should-be-native dummy dummy@42 dummy | 76 | guix lint -c inputs-should-be-native dummy dummy@42 dummy |
| @@ -85,8 +80,7 @@ guix lint -c inputs-should-be-native dummy dummy@42 dummy | |||
| 85 | unset GUIX_PACKAGE_PATH | 80 | unset GUIX_PACKAGE_PATH |
| 86 | 81 | ||
| 87 | out=`guix lint -L $module_dir -c synopsis,description dummy 2>&1` | 82 | out=`guix lint -L $module_dir -c synopsis,description dummy 2>&1` |
| 88 | if [ `grep_warning "$out"` -ne 3 ] | 83 | test `grep_warning "$out"` -eq 3 |
| 89 | then false; else true; fi | ||
| 90 | 84 | ||
| 91 | # Make sure specifying multiple packages works. | 85 | # Make sure specifying multiple packages works. |
| 92 | guix lint -L $module_dir -c inputs-should-be-native dummy dummy@42 dummy | 86 | guix lint -L $module_dir -c inputs-should-be-native dummy dummy@42 dummy |
