diff options
| author | Bernhard Voelker <mail@bernhard-voelker.de> | 2018-10-21 21:56:43 +0200 |
|---|---|---|
| committer | Bernhard Voelker <mail@bernhard-voelker.de> | 2018-10-26 10:54:11 +0200 |
| commit | 7fd7709a7a5f3537f2f373dcc57e17001830591e (patch) | |
| tree | 72512cd42ebb7bc8a1e2a28a725b679587c5e78a /scripts/git-hooks/commit-msg | |
| parent | test: remove support for the ambigous -a unary operator (diff) | |
| download | coreutils-7fd7709a7a5f3537f2f373dcc57e17001830591e.tar.gz coreutils-7fd7709a7a5f3537f2f373dcc57e17001830591e.zip | |
test: simplify redundant code
Remove the function 'test_unop', as the cases therein are redundant to
those handled by 'unary_operator'; exception: the cases 'o' and 'N':
they had been present in test_unop and handling the commands
test -N STR
test -o STR
and
test x = x -a -N STR
test x = x -a -o STR
which ran into an error later on anyway.
With this commit, the error diagnostic will change from ...
$ /usr/bin/test -N STR
/usr/bin/test: extra argument '-N'
$ /usr/bin/test -o STR
/usr/bin/test: extra argument '-o'
... to ...
$ src/test -N STR
src/test: '-N': unary operator expected
$ src/test -o STR
src/test: '-o': unary operator expected
* src/test.c (test_unop): Remove.
(unary_operator): Fail with test_syntax_error in the default case.
(term): Directly call unary_operator.
(two_arguments): Likewise.
* tests/misc/test-diag.pl: Adjust error diagnostic.
Diffstat (limited to 'scripts/git-hooks/commit-msg')
0 files changed, 0 insertions, 0 deletions
