Skip to content

Commit 655edb8

Browse files
committed
[MERGE #1078] cross-plaform: update tests for xplat
Merge pull request #1078 from obastemur:unicode_tests - `Error/RuntimeCompileStackOverflow.js` is disabled for xplat The expectation was 'Out of stack space'. If testing environment doesn't have a stack space similar to Windows, this test fails. - `Strings/trim.js` and its baseline are updated to test unicode output cases internally
2 parents 75c8a39 + 79b9447 commit 655edb8

File tree

5 files changed

+23
-15
lines changed

5 files changed

+23
-15
lines changed

test/Error/rlexe.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
<default>
119119
<files>RuntimeCompileStackOverflow.js</files>
120120
<baseline>RuntimeCompileStackOverflow.baseline</baseline>
121-
<tags>exclude_forceundodefer,exclude_arm</tags>
121+
<tags>exclude_forceundodefer,exclude_arm,exclude_xplat</tags>
122122
</default>
123123
</test>
124124
<test>

test/GlobalFunctions/GlobalFunctions.baseline

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ test: isFinite(123) : true
77
Expando_In_IsNaN_Ok
88
*** Test URI functions ***
99
Test print wchar: "\u00a9"
10-
10+
true
1111
Test encode : encodeURI("\u00a9");
1212
%C2%A9
1313
Test decode back:
14-
14+
true
1515
Test encode : encodeURI("http://www.isp.com/app.cgi?arg1=1&arg2=hello world");
1616
http://www.isp.com/app.cgi?arg1=1&arg2=hello%20world
1717
Test decode back:

test/GlobalFunctions/GlobalFunctions.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,19 @@ WScript.Echo("test: isFinite(123) : " + nn);
2424
isFinite.foo = "Expando_In_IsFinite_Ok";
2525
WScript.Echo(isNaN.foo);
2626

27+
function GetCharCodes(str) {
28+
var result = [];
29+
str.split("").forEach(function(_,i,a) {
30+
result.push(a[i].charCodeAt(0));
31+
});
32+
33+
return result.join();
34+
}
2735

2836
WScript.Echo("*** Test URI functions ***");
2937
var checkChar = "\u00a9";
3038
WScript.Echo("Test print wchar: \"\\u00a9\" ");
31-
WScript.Echo(checkChar);
39+
WScript.Echo(GetCharCodes(checkChar) == "169");
3240

3341
var a = encodeURI("\u00a9");
3442
WScript.Echo("Test encode : encodeURI(\"\\u00a9\");");
@@ -37,7 +45,7 @@ WScript.Echo(a);
3745

3846
WScript.Echo("Test decode back: ")
3947
var b = decodeURI(encodeURI("\u00a9"));
40-
WScript.Echo(b);
48+
WScript.Echo(GetCharCodes(b) == "169");
4149

4250
WScript.Echo("Test encode : encodeURI(\"http:\/\/www.isp.com\/app.cgi?arg1=1&arg2=hello world\");");
4351
a = encodeURI("http://www.isp.com/app.cgi?arg1=1&arg2=hello world");
@@ -76,4 +84,4 @@ WScript.Echo("Escape Unescape ");
7684
WScript.Echo(escape("Hello World"));
7785
WScript.Echo(unescape("Hello%20World"));
7886
WScript.Echo(unescape(escape("foo bar")));
79-
WScript.Echo(unescape("It%27s%20a%20test%21"));
87+
WScript.Echo(unescape("It%27s%20a%20test%21"));

test/Strings/trim.baseline

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ ab c
2323
ab c
2424
ab c
2525
ab c
26-
ab�c
26+
true
2727
abc
28-
ab�c
28+
true
2929
true
3030
true
3131
abc
@@ -69,9 +69,9 @@ ab c
6969
ab c
7070
ab c
7171
ab c
72-
ab�c
72+
true
7373
abc
74-
ab�c
74+
true
7575
true
7676
true
7777
abc

test/Strings/trim.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ WScript.Echo("ab\u0009c".trim());
2828
WScript.Echo("ab\u000Bc".trim());
2929
WScript.Echo("ab\u000Cc".trim());
3030
WScript.Echo("ab\u0020c".trim());
31-
WScript.Echo("ab\u0085c".trim());
31+
WScript.Echo("ab\u0085c".trim() == "ab\u0085c");
3232
WScript.Echo("\u000Babc".trim());
33-
WScript.Echo("ab\u00A0c".trim());
33+
WScript.Echo("ab\u00A0c".trim() == "ab\u00A0c");
3434
WScript.Echo("ab\u200Bc".trim() == "ab\u200Bc");
3535
WScript.Echo("ab\uFEFFc".trim() == "ab\uFEFFc");
3636
WScript.Echo("\u000Aabc".trim());
@@ -76,9 +76,9 @@ WScript.Echo("ab\u0009c".trimRight());
7676
WScript.Echo("ab\u000Bc".trimRight());
7777
WScript.Echo("ab\u000Cc".trimRight());
7878
WScript.Echo("ab\u0020c".trimRight());
79-
WScript.Echo("ab\u0085c".trimRight());
79+
WScript.Echo("ab\u0085c".trimRight() == "ab\u0085c");
8080
WScript.Echo("\u000Babc".trimLeft());
81-
WScript.Echo("ab\u00A0c".trimRight());
81+
WScript.Echo("ab\u00A0c".trimRight() == "ab\u00A0c");
8282
WScript.Echo("ab\u200Bc".trimRight() == "ab\u200Bc");
8383
WScript.Echo("ab\uFEFFc".trimLeft() == "ab\uFEFFc");
8484
WScript.Echo("\u000Aabc".trimLeft());
@@ -104,4 +104,4 @@ var obj = {toString: function(){ a=3; return "Hello World";}};
104104
a = b;
105105
Object.prototype.split = String.prototype.split;
106106
var f = obj.split();
107-
WScript.Echo (a);
107+
WScript.Echo (a);

0 commit comments

Comments
 (0)