28 var stringTransform =
Cc[
"@songbirdnest.com/Songbird/Intl/StringTransform;1"]
29 .createInstance(
Ci.sbIStringTransform);
30 var testOut = stringTransform.normalizeString(
"",
33 log(
"Pre-normalized string: '" + aTestIn +
"'");
34 log(
"Expected normalized string: '" + aTestExpectedOut +
"'");
35 log(
"Normalized string: '" + testOut +
"'");
41 testTransform(
"àäâéçîïë l'été est génial",
"aaaeciie l'ete est genial",
42 Ci.sbIStringTransform.TRANSFORM_IGNORE_NONSPACE);
45 Ci.sbIStringTransform.TRANSFORM_IGNORE_NONSPACE);
51 Ci.sbIStringTransform.TRANSFORM_IGNORE_SYMBOLS);
54 Ci.sbIStringTransform.TRANSFORM_IGNORE_SYMBOLS |
55 Ci.sbIStringTransform.TRANSFORM_IGNORE_LEADING);
58 Ci.sbIStringTransform.TRANSFORM_IGNORE_NONALPHANUM);
61 Ci.sbIStringTransform.TRANSFORM_IGNORE_NONALPHANUM |
62 Ci.sbIStringTransform.TRANSFORM_IGNORE_LEADING);
65 Ci.sbIStringTransform.TRANSFORM_IGNORE_NONALPHANUM);
68 Ci.sbIStringTransform.TRANSFORM_IGNORE_NONALPHANUM |
69 Ci.sbIStringTransform.TRANSFORM_IGNORE_LEADING);
72 Ci.sbIStringTransform.TRANSFORM_IGNORE_NONALPHANUM_IGNORE_SPACE);
75 Ci.sbIStringTransform.TRANSFORM_IGNORE_NONALPHANUM_IGNORE_SPACE |
76 Ci.sbIStringTransform.TRANSFORM_IGNORE_LEADING);
79 Ci.sbIStringTransform.TRANSFORM_IGNORE_NONALPHANUM_IGNORE_SPACE |
80 Ci.sbIStringTransform.TRANSFORM_IGNORE_LEADING);
84 Ci.sbIStringTransform.TRANSFORM_IGNORE_NONALPHANUM_IGNORE_SPACE |
85 Ci.sbIStringTransform.TRANSFORM_IGNORE_LEADING |
86 Ci.sbIStringTransform.TRANSFORM_IGNORE_KEEPNUMBERSYMBOLS);
89 Ci.sbIStringTransform.TRANSFORM_IGNORE_NONALPHANUM_IGNORE_SPACE |
90 Ci.sbIStringTransform.TRANSFORM_IGNORE_LEADING |
91 Ci.sbIStringTransform.TRANSFORM_IGNORE_KEEPNUMBERSYMBOLS);
94 Ci.sbIStringTransform.TRANSFORM_IGNORE_NONALPHANUM_IGNORE_SPACE |
95 Ci.sbIStringTransform.TRANSFORM_IGNORE_LEADING);
98 Ci.sbIStringTransform.TRANSFORM_IGNORE_NONALPHANUM_IGNORE_SPACE |
99 Ci.sbIStringTransform.TRANSFORM_IGNORE_LEADING |
100 Ci.sbIStringTransform.TRANSFORM_IGNORE_KEEPNUMBERSYMBOLS);
103 Ci.sbIStringTransform.TRANSFORM_IGNORE_NONALPHANUM_IGNORE_SPACE |
104 Ci.sbIStringTransform.TRANSFORM_IGNORE_LEADING);
107 Ci.sbIStringTransform.TRANSFORM_IGNORE_NONALPHANUM_IGNORE_SPACE |
108 Ci.sbIStringTransform.TRANSFORM_IGNORE_LEADING |
109 Ci.sbIStringTransform.TRANSFORM_IGNORE_KEEPNUMBERSYMBOLS);
112 Ci.sbIStringTransform.TRANSFORM_IGNORE_NONALPHANUM_IGNORE_SPACE |
113 Ci.sbIStringTransform.TRANSFORM_IGNORE_LEADING);
116 Ci.sbIStringTransform.TRANSFORM_IGNORE_NONALPHANUM_IGNORE_SPACE |
117 Ci.sbIStringTransform.TRANSFORM_IGNORE_LEADING |
118 Ci.sbIStringTransform.TRANSFORM_IGNORE_KEEPNUMBERSYMBOLS);
121 Ci.sbIStringTransform.TRANSFORM_IGNORE_NONALPHANUM_IGNORE_SPACE |
122 Ci.sbIStringTransform.TRANSFORM_IGNORE_LEADING);
125 Ci.sbIStringTransform.TRANSFORM_IGNORE_NONALPHANUM_IGNORE_SPACE |
126 Ci.sbIStringTransform.TRANSFORM_IGNORE_LEADING |
127 Ci.sbIStringTransform.TRANSFORM_IGNORE_KEEPNUMBERSYMBOLS);
130 Ci.sbIStringTransform.TRANSFORM_IGNORE_NONALPHANUM_IGNORE_SPACE |
131 Ci.sbIStringTransform.TRANSFORM_IGNORE_LEADING);
134 Ci.sbIStringTransform.TRANSFORM_IGNORE_NONALPHANUM_IGNORE_SPACE |
135 Ci.sbIStringTransform.TRANSFORM_IGNORE_LEADING |
136 Ci.sbIStringTransform.TRANSFORM_IGNORE_KEEPNUMBERSYMBOLS);
139 Ci.sbIStringTransform.TRANSFORM_IGNORE_NONALPHANUM_IGNORE_SPACE |
140 Ci.sbIStringTransform.TRANSFORM_IGNORE_LEADING);
143 Ci.sbIStringTransform.TRANSFORM_IGNORE_NONALPHANUM_IGNORE_SPACE |
144 Ci.sbIStringTransform.TRANSFORM_IGNORE_LEADING |
145 Ci.sbIStringTransform.TRANSFORM_IGNORE_KEEPNUMBERSYMBOLS);
148 Ci.sbIStringTransform.TRANSFORM_IGNORE_NONALPHANUM_IGNORE_SPACE |
149 Ci.sbIStringTransform.TRANSFORM_IGNORE_LEADING);
152 Ci.sbIStringTransform.TRANSFORM_IGNORE_NONALPHANUM_IGNORE_SPACE |
153 Ci.sbIStringTransform.TRANSFORM_IGNORE_LEADING |
154 Ci.sbIStringTransform.TRANSFORM_IGNORE_KEEPNUMBERSYMBOLS);
157 Ci.sbIStringTransform.TRANSFORM_IGNORE_NONALPHANUM_IGNORE_SPACE |
158 Ci.sbIStringTransform.TRANSFORM_IGNORE_LEADING);
160 testTransform(
"I have àäâéçîïë $+5! How about that?! heh!",
"I have aaaeciie +5 How about that heh",
161 Ci.sbIStringTransform.TRANSFORM_IGNORE_NONSPACE |
162 Ci.sbIStringTransform.TRANSFORM_IGNORE_NONALPHANUM |
163 Ci.sbIStringTransform.TRANSFORM_IGNORE_KEEPNUMBERSYMBOLS);
165 testTransform(
"I have àäâéçîïë $+5! How about that?! heh!",
"Ihaveaaaeciie+5Howaboutthatheh",
166 Ci.sbIStringTransform.TRANSFORM_IGNORE_NONSPACE |
167 Ci.sbIStringTransform.TRANSFORM_IGNORE_NONALPHANUM_IGNORE_SPACE |
168 Ci.sbIStringTransform.TRANSFORM_IGNORE_KEEPNUMBERSYMBOLS);
function assertEqual(aExpected, aActual, aMessage)