diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-07-30 20:45:48 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-07-30 20:45:48 +0300 |
commit | 90421400977b3c80fdb8b887c61272a8f3ec0d18 (patch) | |
tree | 36078df61176c416dd93278907ba6bf6a5c851bc /t/t0066-dir-iterator.sh | |
parent | c4d9c506f7a802ed263071c82319098e3fcd0b3e (diff) |
test-dir-iterator: do not assume errno values
A few tests printed 'errno' as an integer and compared with
hardcoded integers; this is obviously not portable.
A two things to note are:
- the string obtained by strerror() is not portable, and cannot be
used for the purpose of these tests.
- there unfortunately isn't a portable way to map error numbers to
error names.
As we only care about a few selected errors, just map the error
number to the name before emitting for comparison.
Reported-by: Randall S. Becker <rsbecker@nexbridge.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0066-dir-iterator.sh')
-rwxr-xr-x | t/t0066-dir-iterator.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/t/t0066-dir-iterator.sh b/t/t0066-dir-iterator.sh index 9354d3f1ed..92910e4e6c 100755 --- a/t/t0066-dir-iterator.sh +++ b/t/t0066-dir-iterator.sh @@ -55,13 +55,13 @@ test_expect_success 'dir-iterator should list files in the correct order' ' test_expect_success 'begin should fail upon inexistent paths' ' test_must_fail test-tool dir-iterator ./inexistent-path \ >actual-inexistent-path-output && - echo "dir_iterator_begin failure: 2" >expected-inexistent-path-output && + echo "dir_iterator_begin failure: ENOENT" >expected-inexistent-path-output && test_cmp expected-inexistent-path-output actual-inexistent-path-output ' test_expect_success 'begin should fail upon non directory paths' ' test_must_fail test-tool dir-iterator ./dir/b >actual-non-dir-output && - echo "dir_iterator_begin failure: 20" >expected-non-dir-output && + echo "dir_iterator_begin failure: ENOTDIR" >expected-non-dir-output && test_cmp expected-non-dir-output actual-non-dir-output ' |