diff options
author | 2013-11-26 10:52:03 -0800 | |
---|---|---|
committer | 2013-11-26 10:52:32 -0800 | |
commit | 51214177256be1127d793cbc1b40aec04d6856d8 (patch) | |
tree | 17ff64627218927a1caae9c94bafaa4a62de461d /fish_tests.cpp | |
parent | 2c39d5b6c00f6f73af1342eb8f76866aae4de1a3 (diff) |
Fix for annoying error message when converting out of range escape
Diffstat (limited to 'fish_tests.cpp')
-rw-r--r-- | fish_tests.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/fish_tests.cpp b/fish_tests.cpp index 321d109b..b226d307 100644 --- a/fish_tests.cpp +++ b/fish_tests.cpp @@ -144,6 +144,22 @@ static void test_unescape_sane() err(L"In unescaping '%ls', expected '%ls' but got '%ls'\n", tests[i].input, tests[i].expected, output.c_str()); } } + + // test for overflow + if (unescape_string(L"echo \\UFFFFFF", &output, UNESCAPE_DEFAULT)) + { + err(L"Should not have been able to unescape \\UFFFFFF\n"); + } + if (unescape_string(L"echo \\U110000", &output, UNESCAPE_DEFAULT)) + { + err(L"Should not have been able to unescape \\U110000\n"); + } + if (! unescape_string(L"echo \\U10FFFF", &output, UNESCAPE_DEFAULT)) + { + err(L"Should have been able to unescape \\U10FFFF\n"); + } + + } /** |