blame: fix -L bounds checking bug
[gitweb.git] / t / t3900-i18n-commit.sh
index 051ea9d3c289d825601aed0a3055b1565370dc3a..4bf1dbe9c9f3ffeb1151be07bf75dcd872167916 100755 (executable)
@@ -34,9 +34,9 @@ test_expect_success 'no encoding header for base case' '
        test z = "z$E"
 '
 
-test_expect_failure 'UTF-16 refused because of NULs' '
+test_expect_success 'UTF-16 refused because of NULs' '
        echo UTF-16 >F &&
-       git commit -a -F "$TEST_DIRECTORY"/t3900/UTF-16.txt
+       test_must_fail git commit -a -F "$TEST_DIRECTORY"/t3900/UTF-16.txt
 '
 
 test_expect_success 'UTF-8 invalid characters refused' '
@@ -58,6 +58,24 @@ test_expect_success 'UTF-8 overlong sequences rejected' '
        grep "did not conform" "$HOME"/stderr
 '
 
+test_expect_success 'UTF-8 non-characters refused' '
+       test_when_finished "rm -f $HOME/stderr $HOME/invalid" &&
+       echo "UTF-8 non-character 1" >F &&
+       printf "Commit message\n\nNon-character:\364\217\277\276\n" \
+               >"$HOME/invalid" &&
+       git commit -a -F "$HOME/invalid" 2>"$HOME"/stderr &&
+       grep "did not conform" "$HOME"/stderr
+'
+
+test_expect_success 'UTF-8 non-characters refused' '
+       test_when_finished "rm -f $HOME/stderr $HOME/invalid" &&
+       echo "UTF-8 non-character 2." >F &&
+       printf "Commit message\n\nNon-character:\357\267\220\n" \
+               >"$HOME/invalid" &&
+       git commit -a -F "$HOME/invalid" 2>"$HOME"/stderr &&
+       grep "did not conform" "$HOME"/stderr
+'
+
 for H in ISO8859-1 eucJP ISO-2022-JP
 do
        test_expect_success "$H setup" '