Skip to content

Commit

Permalink
[MERGE #4632 @obastemur] string-test: fix localCompare test
Browse files Browse the repository at this point in the history
Merge pull request #4632 from obastemur:fix_test_strcmp

spec asks for `<`, `=`, or `>` while our baseline was expecting a particular output.
  • Loading branch information
obastemur committed Feb 1, 2018
2 parents 965f779 + 497d3d9 commit 3962348
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 0 additions & 4 deletions test/Strings/compare.baseline

This file was deleted.

13 changes: 9 additions & 4 deletions test/Strings/compare.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------

WScript.Echo("Basic string compare.");
WScript.LoadScriptFile("..\\UnitTestFramework\\UnitTestFramework.js", "self");

var str1 = "abcd1234"
var str2 = "1234567a"
var str3 = "abcd12345"
var str1a = "abcd1234"

WScript.Echo("compare ( '" + str1 + "' , '" + str1a + "' ) = " + str1.localeCompare(str1a));
WScript.Echo("compare ( '" + str1 + "' , '" + str2 + "' ) = " + str1.localeCompare(str2));
WScript.Echo("compare ( '" + str1 + "' , undef ) = " + str1.localeCompare());
assert.isTrue(str1.localeCompare(str1a) == 0);
assert.isTrue(str1.localeCompare(str2) > 0);
assert.isTrue(str1.localeCompare(str3) < 0);
assert.isTrue(str1.localeCompare() < 0);

console.log("pass")
1 change: 0 additions & 1 deletion test/Strings/rlexe.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@
<test>
<default>
<files>compare.js</files>
<baseline>compare.baseline</baseline>
</default>
</test>
<test>
Expand Down

0 comments on commit 3962348

Please sign in to comment.