Title: [197969] trunk/LayoutTests
Revision
197969
Author
[email protected]
Date
2016-03-10 16:42:18 -0800 (Thu, 10 Mar 2016)

Log Message

Add shouldNotBe to standalone test harness
https://bugs.webkit.org/show_bug.cgi?id=155300

Patch by Andy VanWagoner <[email protected]> on 2016-03-10
Reviewed by Saam Barati.

Copy over the shouldNotBe function from js-test-pre. This fixes errors
introduced be new Intl tests.

* resources/standalone-pre.js:
(shouldNotBe):

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (197968 => 197969)


--- trunk/LayoutTests/ChangeLog	2016-03-11 00:34:57 UTC (rev 197968)
+++ trunk/LayoutTests/ChangeLog	2016-03-11 00:42:18 UTC (rev 197969)
@@ -1,3 +1,16 @@
+2016-03-10  Andy VanWagoner  <[email protected]>
+
+        Add shouldNotBe to standalone test harness
+        https://bugs.webkit.org/show_bug.cgi?id=155300
+
+        Reviewed by Saam Barati.
+
+        Copy over the shouldNotBe function from js-test-pre. This fixes errors
+        introduced be new Intl tests.
+
+        * resources/standalone-pre.js:
+        (shouldNotBe):
+
 2016-03-10  Ryan Haddad  <[email protected]>
 
         Rebaseline two inspector tests after r197954 changed the results.

Modified: trunk/LayoutTests/resources/standalone-pre.js (197968 => 197969)


--- trunk/LayoutTests/resources/standalone-pre.js	2016-03-11 00:34:57 UTC (rev 197968)
+++ trunk/LayoutTests/resources/standalone-pre.js	2016-03-11 00:42:18 UTC (rev 197969)
@@ -193,6 +193,29 @@
   }
 }
 
+function shouldNotBe(_a, _b, quiet)
+{
+  if (typeof _a != "string" || typeof _b != "string")
+    debug("WARN: shouldNotBe() expects string arguments");
+  var exception;
+  var _av;
+  try {
+     _av = eval(_a);
+  } catch (e) {
+     exception = e;
+  }
+  var _bv = eval(_b);
+
+  if (exception)
+    testFailed(_a + " should not be " + _bv + ". Threw exception " + exception);
+  else if (!isResultCorrect(_av, _bv)) {
+    if (!quiet) {
+        testPassed(_a + " is not " + _b);
+    }
+  } else
+    testFailed(_a + " should not be " + _bv + ".");
+}
+
 function shouldBeTrue(_a) { shouldBe(_a, "true"); }
 function shouldBeFalse(_a) { shouldBe(_a, "false"); }
 function shouldBeNaN(_a) { shouldBe(_a, "NaN"); }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to