Oops, forgot to add this file.
authorggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Mar 2006 02:07:09 +0000 (02:07 +0000)
committerggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Mar 2006 02:07:09 +0000 (02:07 +0000)
        * fast/js/resources/string-sort.js: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@13296 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/js/resources/string-sort.js [new file with mode: 0644]

index a95397072be29c93ba7d4764f33dea44f1369b38..3c20ba3352f98d0108f9544d6291a6a3d63da01b 100644 (file)
@@ -1,3 +1,9 @@
+2006-03-14  Geoffrey Garen  <ggaren@apple.com>
+
+        Oops, forgot to add this file.
+
+        * fast/js/resources/string-sort.js: Added.
+
 2006-03-14  Geoffrey Garen  <ggaren@apple.com>
 
         Reviewed by Eric.
diff --git a/LayoutTests/fast/js/resources/string-sort.js b/LayoutTests/fast/js/resources/string-sort.js
new file mode 100644 (file)
index 0000000..a695806
--- /dev/null
@@ -0,0 +1,19 @@
+description("This page tests sorting of string values");
+
+function shouldBeInThisOrder(a)
+{
+    shouldBeTrue('"' + a[0] + '"' + " < " + '"' + a[1] + '"');
+    shouldBe('[' + '"' + a[0] + '"' + ',' + '"' + a[1] + '"' + '].sort().toString()', '"' + a + '"');
+}
+
+shouldBeInThisOrder(["12", "123"]);
+shouldBeInThisOrder(["123", "13"]);
+shouldBeInThisOrder(["", " "]);
+shouldBeInThisOrder(["close", "closed"]);
+shouldBeInThisOrder(["a", "~"]);
+shouldBeInThisOrder(["_", "a"]);
+shouldBeInThisOrder(["0", "A"]);
+shouldBeInThisOrder(["-", "0"]);
+shouldBeInThisOrder([" ", "-"]);
+
+var successfullyParsed = true;