ICU-1098 Test for parsing escapes.
X-SVN-Rev: 5833
diff --git a/icu4c/source/test/cintltst/creststn.c b/icu4c/source/test/cintltst/creststn.c
index b039ea1..44612d8 100644
--- a/icu4c/source/test/cintltst/creststn.c
+++ b/icu4c/source/test/cintltst/creststn.c
@@ -250,6 +250,9 @@
const UChar *empty = NULL;
const UChar *zeroString;
UChar expected[] = { 'a','b','c','\0','d','e','f' };
+ const char* expect ="tab:\t cr:\r ff:\f newline:\n backslash:\\\\ quote=\\\' doubleQuote=\\\" singlequoutes=''";
+ UChar uExpect[200];
+ u_charsToUChars(expect,uExpect,uprv_strlen(expect)+1);
strcpy(action, "Construction of testtypes bundle");
strcpy(testdatapath, directory);
@@ -357,6 +360,15 @@
CONFIRM_INT_EQ(intResult, 123);
}
+ /* this tests if escapes are preserved or not */
+ {
+ int len =0;
+ const UChar* str = ures_getStringByKey(theBundle,"testescape",&len,&status);
+ CONFIRM_ErrorCode(status, U_ZERO_ERROR);
+ if(u_strcmp(uExpect,str)){
+ log_err("Did not get the expected string for testescape");
+ }
+ }
ures_close(res);
ures_close(theBundle);
diff --git a/icu4c/source/test/testdata/testtypes.txt b/icu4c/source/test/testdata/testtypes.txt
index e8859c6..41a1a61 100644
--- a/icu4c/source/test/testdata/testtypes.txt
+++ b/icu4c/source/test/testdata/testtypes.txt
@@ -12,7 +12,7 @@
{
zerotest { "abc\u0000def" } // The length of this string should be 7, not 3
binarytest:bin { 000102030405060708090a0b0c0d0e } // Binary 15 bytes long
- onehundredtwentythree:int { 123 } //
+ onehundredtwentythree:int {123 } //
one:int { 1 } // number one
importtest:import { "importtest.bin" }
integerarray:intvector { 1, 2, 3, -3, 4, 5, 6, 7 } // an array of 32-bit integers
@@ -29,6 +29,8 @@
emptyarray:array
{
}
+ testescape{ "tab:\t cr:\r ff:\f newline:\n backslash:\\ quote=\' doubleQuote=\" singlequoutes=''" }
+
}