tests: don't rely on strerror text when testing rmdir failure
authorCharles Bailey <cbailey32@bloomberg.net>
Sat, 29 Mar 2014 15:39:01 +0000 (15:39 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 31 Mar 2014 18:53:24 +0000 (11:53 -0700)
AIX doesn't make a distiction between EEXIST and ENOTEMPTY; relying
on the strerror string for the rmdir failure is fragile. Just test
that the start of the string matches the Git controlled "failed to
rmdir..." error. The exact text of the OS generated error string
isn't important to the test.

Signed-off-by: Charles Bailey <cbailey32@bloomberg.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3600-rm.sh
t/t7001-mv.sh
index 3d305814b9d755a827d27ed9036ebb2f8d48abe6..e00d7d2b6186023642bc9d0b5d5dd6a526278767 100755 (executable)
@@ -711,8 +711,7 @@ test_expect_success 'checking out a commit after submodule removal needs manual
        git submodule update &&
        git checkout -q HEAD^ 2>actual &&
        git checkout -q master 2>actual &&
-       echo "warning: unable to rmdir submod: Directory not empty" >expected &&
-       test_i18ncmp expected actual &&
+       test_i18ngrep "^warning: unable to rmdir submod:" actual &&
        git status -s submod >actual &&
        echo "?? submod/" >expected &&
        test_cmp expected actual &&
index e3c8c2c1b8817acd85866470c6f76c4a4f8d17d7..e3290aafe7c244f6258c7925ad4a051b24aa8e2e 100755 (executable)
@@ -446,8 +446,7 @@ test_expect_success 'checking out a commit before submodule moved needs manual u
        git mv sub sub2 &&
        git commit -m "moved sub to sub2" &&
        git checkout -q HEAD^ 2>actual &&
-       echo "warning: unable to rmdir sub2: Directory not empty" >expected &&
-       test_i18ncmp expected actual &&
+       test_i18ngrep "^warning: unable to rmdir sub2:" actual &&
        git status -s sub2 >actual &&
        echo "?? sub2/" >expected &&
        test_cmp expected actual &&