mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 414064 part 2. Add some tests.
This commit is contained in:
parent
93e981814b
commit
72394837e1
14
intl/uconv/tests/unit/test_decode_utf-7.js
Normal file
14
intl/uconv/tests/unit/test_decode_utf-7.js
Normal file
@ -0,0 +1,14 @@
|
||||
// Tests conversion from UTF-7 to Unicode. The conversion should fail!
|
||||
|
||||
load('CharsetConversionTests.js');
|
||||
|
||||
const inString = "+LGI--+ITIipSIp- +AocCeQ-oddns +Ad0CjQ- s+ATECZQKH- p+AlAB3QJ5- u+AlACVA- no+Ao4- +Al8-I";
|
||||
|
||||
const expectedString = "+LGI--+ITIipSIp- +AocCeQ-oddns +Ad0CjQ- s+ATECZQKH- p+AlAB3QJ5- u+AlACVA- no+Ao4- +Al8-I";
|
||||
|
||||
const aliases = [ "UTF-7", "utf-7", "x-unicode-2-0-utf-7", "unicode-2-0-utf-7",
|
||||
"unicode-1-1-utf-7", "csunicode11utf7" ];
|
||||
|
||||
function run_test() {
|
||||
testDecodeAliases();
|
||||
}
|
14
intl/uconv/tests/unit/test_decode_utf-7_internal.js
Normal file
14
intl/uconv/tests/unit/test_decode_utf-7_internal.js
Normal file
@ -0,0 +1,14 @@
|
||||
// Tests conversion from UTF-7 to Unicode.
|
||||
|
||||
load('CharsetConversionTests.js');
|
||||
|
||||
const inString = "+LGI--+ITIipSIp- +AocCeQ-oddns +Ad0CjQ- s+ATECZQKH- p+AlAB3QJ5- u+AlACVA- no+Ao4- +Al8-I";
|
||||
|
||||
const expectedString = "\u2C62-\u2132\u22A5\u2229 \u0287\u0279oddns \u01DD\u028D s\u0131\u0265\u0287 p\u0250\u01DD\u0279 u\u0250\u0254 no\u028E \u025FI";
|
||||
|
||||
const aliases = [ "UTF-7", "utf-7", "x-unicode-2-0-utf-7", "unicode-2-0-utf-7",
|
||||
"unicode-1-1-utf-7", "csunicode11utf7" ];
|
||||
|
||||
function run_test() {
|
||||
testDecodeAliasesInternal();
|
||||
}
|
14
intl/uconv/tests/unit/test_encode_utf-7.js
Normal file
14
intl/uconv/tests/unit/test_encode_utf-7.js
Normal file
@ -0,0 +1,14 @@
|
||||
// Tests conversion from Unicode to UTF-7. The conversion should fail!
|
||||
|
||||
load('CharsetConversionTests.js');
|
||||
|
||||
const inString = "\u2C62-\u2132\u22A5\u2229 \u0287\u0279oddns \u01DD\u028D s\u0131\u0265\u0287 p\u0250\u01DD\u0279 u\u0250\u0254 no\u028E \u025FI";
|
||||
|
||||
const expectedString = "?-??? ??oddns ?? s??? p??? u?? no? ?I";
|
||||
|
||||
const aliases = [ "UTF-7", "utf-7", "x-unicode-2-0-utf-7", "unicode-2-0-utf-7",
|
||||
"unicode-1-1-utf-7", "csunicode11utf7" ];
|
||||
|
||||
function run_test() {
|
||||
testEncodeAliases();
|
||||
}
|
14
intl/uconv/tests/unit/test_encode_utf-7_internal.js
Normal file
14
intl/uconv/tests/unit/test_encode_utf-7_internal.js
Normal file
@ -0,0 +1,14 @@
|
||||
// Tests conversion from Unicode to UTF-7.
|
||||
|
||||
load('CharsetConversionTests.js');
|
||||
|
||||
const inString = "\u2C62-\u2132\u22A5\u2229 \u0287\u0279oddns \u01DD\u028D s\u0131\u0265\u0287 p\u0250\u01DD\u0279 u\u0250\u0254 no\u028E \u025FI";
|
||||
|
||||
const expectedString = "+LGI--+ITIipSIp- +AocCeQ-oddns +Ad0CjQ- s+ATECZQKH- p+AlAB3QJ5- u+AlACVA- no+Ao4- +Al8-I";
|
||||
|
||||
const aliases = [ "UTF-7", "utf-7", "x-unicode-2-0-utf-7", "unicode-2-0-utf-7",
|
||||
"unicode-1-1-utf-7", "csunicode11utf7" ];
|
||||
|
||||
function run_test() {
|
||||
testEncodeAliasesInternal();
|
||||
}
|
Loading…
Reference in New Issue
Block a user