Procházet zdrojové kódy

[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
Oguz Bastemur před 9 roky
rodič
revize
655edb8d14

+ 1 - 1
test/Error/rlexe.xml

@@ -118,7 +118,7 @@
     <default>
       <files>RuntimeCompileStackOverflow.js</files>
       <baseline>RuntimeCompileStackOverflow.baseline</baseline>
-      <tags>exclude_forceundodefer,exclude_arm</tags>
+      <tags>exclude_forceundodefer,exclude_arm,exclude_xplat</tags>
     </default>
   </test>
   <test>

+ 2 - 2
test/GlobalFunctions/GlobalFunctions.baseline

@@ -7,11 +7,11 @@ test: isFinite(123) : true
 Expando_In_IsNaN_Ok
 *** Test URI  functions ***
 Test print wchar: "\u00a9" 
-©
+true
 Test encode : encodeURI("\u00a9");
 %C2%A9
 Test decode back: 
-©
+true
 Test encode :  encodeURI("http://www.isp.com/app.cgi?arg1=1&arg2=hello world");
 http://www.isp.com/app.cgi?arg1=1&arg2=hello%20world
 Test decode back: 

+ 11 - 3
test/GlobalFunctions/GlobalFunctions.js

@@ -24,11 +24,19 @@ WScript.Echo("test: isFinite(123) : " + nn);
 isFinite.foo = "Expando_In_IsFinite_Ok";
 WScript.Echo(isNaN.foo);
 
+function GetCharCodes(str) {
+    var result = [];
+    str.split("").forEach(function(_,i,a) {
+      result.push(a[i].charCodeAt(0));
+    });
+
+    return result.join();
+}
 
 WScript.Echo("*** Test URI  functions ***");
 var checkChar = "\u00a9";
 WScript.Echo("Test print wchar: \"\\u00a9\" ");
-WScript.Echo(checkChar);
+WScript.Echo(GetCharCodes(checkChar) == "169");
 
 var a = encodeURI("\u00a9");
 WScript.Echo("Test encode : encodeURI(\"\\u00a9\");");
@@ -37,7 +45,7 @@ WScript.Echo(a);
 
 WScript.Echo("Test decode back: ")
 var b = decodeURI(encodeURI("\u00a9"));
-WScript.Echo(b);
+WScript.Echo(GetCharCodes(b) == "169");
 
 WScript.Echo("Test encode :  encodeURI(\"http:\/\/www.isp.com\/app.cgi?arg1=1&arg2=hello world\");");
 a = encodeURI("http://www.isp.com/app.cgi?arg1=1&arg2=hello world");
@@ -76,4 +84,4 @@ WScript.Echo("Escape Unescape ");
 WScript.Echo(escape("Hello World"));
 WScript.Echo(unescape("Hello%20World"));
 WScript.Echo(unescape(escape("foo bar")));
-WScript.Echo(unescape("It%27s%20a%20test%21"));
+WScript.Echo(unescape("It%27s%20a%20test%21"));

+ 4 - 4
test/Strings/trim.baseline

@@ -23,9 +23,9 @@ ab	c
 abc
 abc
 ab c
-ab…c
+true
 abc
-ab c
+true
 true
 true
 abc
@@ -69,9 +69,9 @@ ab	c
 abc
 abc
 ab c
-ab…c
+true
 abc
-ab c
+true
 true
 true
 abc

+ 5 - 5
test/Strings/trim.js

@@ -28,9 +28,9 @@ WScript.Echo("ab\u0009c".trim());
 WScript.Echo("ab\u000Bc".trim());
 WScript.Echo("ab\u000Cc".trim());
 WScript.Echo("ab\u0020c".trim());
-WScript.Echo("ab\u0085c".trim());
+WScript.Echo("ab\u0085c".trim() == "ab\u0085c");
 WScript.Echo("\u000Babc".trim());
-WScript.Echo("ab\u00A0c".trim());
+WScript.Echo("ab\u00A0c".trim() == "ab\u00A0c");
 WScript.Echo("ab\u200Bc".trim() == "ab\u200Bc");
 WScript.Echo("ab\uFEFFc".trim() == "ab\uFEFFc");
 WScript.Echo("\u000Aabc".trim());
@@ -76,9 +76,9 @@ WScript.Echo("ab\u0009c".trimRight());
 WScript.Echo("ab\u000Bc".trimRight());
 WScript.Echo("ab\u000Cc".trimRight());
 WScript.Echo("ab\u0020c".trimRight());
-WScript.Echo("ab\u0085c".trimRight());
+WScript.Echo("ab\u0085c".trimRight() == "ab\u0085c");
 WScript.Echo("\u000Babc".trimLeft());
-WScript.Echo("ab\u00A0c".trimRight());
+WScript.Echo("ab\u00A0c".trimRight() == "ab\u00A0c");
 WScript.Echo("ab\u200Bc".trimRight() == "ab\u200Bc");
 WScript.Echo("ab\uFEFFc".trimLeft() == "ab\uFEFFc");
 WScript.Echo("\u000Aabc".trimLeft());
@@ -104,4 +104,4 @@ var obj = {toString: function(){ a=3; return "Hello World";}};
 a = b;
 Object.prototype.split = String.prototype.split;
 var f = obj.split();
-WScript.Echo (a);
+WScript.Echo (a);