<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[205834] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/205834">205834</a></dd>
<dt>Author</dt> <dd>mattbaker@apple.com</dd>
<dt>Date</dt> <dd>2016-09-12 15:36:57 -0700 (Mon, 12 Sep 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Source/WebInspectorUI:
Web Inspector: Improve clarity of inspector tests by adding TestHarness.expect* functions similar to XCTest
https://bugs.webkit.org/show_bug.cgi?id=161278
<rdar://problem/28039741>
Reviewed by Joseph Pecoraro.
Under the hood they all call TestHarness.expectThat.
* UserInterface/Test/TestHarness.js:
(TestHarness.prototype.expectFalse):
(TestHarness.prototype.expectNull):
(TestHarness.prototype.expectNotNull):
(TestHarness.prototype.expectEqual):
(TestHarness.prototype.expectNotEqual):
(TestHarness.prototype.expectShallowEqual):
(TestHarness.prototype.expectNotShallowEqual):
(TestHarness.prototype.expectEqualWithAccuracy):
(TestHarness.prototype.expectLessThan):
(TestHarness.prototype.expectLessThanOrEqual):
(TestHarness.prototype.expectGreaterThan):
(TestHarness.prototype.expectGreaterThanOrEqual):
LayoutTests:
Web Inspector: Add TestHarness assertions/expectations to provide additional semantics similar to XCTest
https://bugs.webkit.org/show_bug.cgi?id=161278
<rdar://problem/28039741>
Reviewed by Joseph Pecoraro.
Add test to verify that the TestHarness.expect* family of functions
trivially work. Since it isn't possible to verify the TestPage results
directly without introducing additional complexity, simply log baseline
"PASS" and "FAIL" results for each function.
* inspector/unit-tests/test-harness-expect-functions-expected.txt: Added.
* inspector/unit-tests/test-harness-expect-functions.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTestTestHarnessjs">trunk/Source/WebInspectorUI/UserInterface/Test/TestHarness.js</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsinspectorunitteststestharnessexpectfunctionsexpectedtxt">trunk/LayoutTests/inspector/unit-tests/test-harness-expect-functions-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectorunitteststestharnessexpectfunctionshtml">trunk/LayoutTests/inspector/unit-tests/test-harness-expect-functions.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (205833 => 205834)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-09-12 22:36:14 UTC (rev 205833)
+++ trunk/LayoutTests/ChangeLog        2016-09-12 22:36:57 UTC (rev 205834)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2016-09-12 Matt Baker <mattbaker@apple.com>
+
+ Web Inspector: Add TestHarness assertions/expectations to provide additional semantics similar to XCTest
+ https://bugs.webkit.org/show_bug.cgi?id=161278
+ <rdar://problem/28039741>
+
+ Reviewed by Joseph Pecoraro.
+
+ Add test to verify that the TestHarness.expect* family of functions
+ trivially work. Since it isn't possible to verify the TestPage results
+ directly without introducing additional complexity, simply log baseline
+ "PASS" and "FAIL" results for each function.
+
+ * inspector/unit-tests/test-harness-expect-functions-expected.txt: Added.
+ * inspector/unit-tests/test-harness-expect-functions.html: Added.
+
</ins><span class="cx"> 2016-09-12 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> window.performance object resets script-applied properties
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorunitteststestharnessexpectfunctionsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/unit-tests/test-harness-expect-functions-expected.txt (0 => 205834)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/unit-tests/test-harness-expect-functions-expected.txt         (rev 0)
+++ trunk/LayoutTests/inspector/unit-tests/test-harness-expect-functions-expected.txt        2016-09-12 22:36:57 UTC (rev 205834)
</span><span class="lines">@@ -0,0 +1,162 @@
</span><ins>+Testing TestHarness.expect* family of functions.
+
+
+== Running test suite: InspectorTestExpectFunctions
+-- Running test case: InspectorTest.expectThat
+Expected to PASS
+PASS: expectThat(true)
+PASS: expectThat(1)
+PASS: expectThat("abc")
+PASS: expectThat({})
+PASS: expectThat([])
+Expected to FAIL
+FAIL: expectThat(false)
+FAIL: expectThat(0)
+FAIL: expectThat("")
+FAIL: expectThat(null)
+FAIL: expectThat(undefined)
+FAIL: expectThat(NaN)
+
+-- Running test case: InspectorTest.expectFalse
+Expected to PASS
+PASS: expectFalse(false)
+PASS: expectFalse(0)
+PASS: expectFalse("")
+PASS: expectFalse(null)
+PASS: expectFalse(undefined)
+PASS: expectFalse(NaN)
+Expected to FAIL
+FAIL: expectFalse(true)
+FAIL: expectFalse(1)
+FAIL: expectFalse("abc")
+FAIL: expectFalse({})
+FAIL: expectFalse([])
+
+-- Running test case: InspectorTest.expectNull
+Expected to PASS
+PASS: expectNull(null)
+Expected to FAIL
+FAIL: expectNull(true)
+FAIL: expectNull(false)
+FAIL: expectNull(1)
+FAIL: expectNull("")
+FAIL: expectNull(undefined)
+FAIL: expectNull({})
+FAIL: expectNull([])
+
+-- Running test case: InspectorTest.expectNotNull
+Expected to PASS
+PASS: expectNotNull(true)
+PASS: expectNotNull(false)
+PASS: expectNotNull(1)
+PASS: expectNotNull("")
+PASS: expectNotNull(undefined)
+PASS: expectNotNull({})
+PASS: expectNotNull([])
+Expected to FAIL
+FAIL: expectNotNull(null)
+
+-- Running test case: InspectorTest.expectEqual
+Expected to PASS
+PASS: expectEqual(true, true)
+PASS: expectEqual({"a":1,"b":2}, {"a":1,"b":2})
+PASS: expectEqual(1.23, 1.23)
+PASS: expectEqual("abc", "abc")
+PASS: expectEqual(null, null)
+PASS: expectEqual(undefined, undefined)
+Expected to FAIL
+FAIL: expectEqual(true, false)
+FAIL: expectEqual({"a":1,"b":2}, {"c":3,"d":4})
+FAIL: expectEqual(1.23, 4.56)
+FAIL: expectEqual("abc", "def")
+FAIL: expectEqual(null, undefined)
+FAIL: expectEqual(NaN, NaN)
+FAIL: expectEqual({}, {})
+FAIL: expectEqual([], [])
+
+-- Running test case: InspectorTest.expectNotEqual
+Expected to PASS
+PASS: expectNotEqual(true, false)
+PASS: expectNotEqual({"a":1,"b":2}, {"c":3,"d":4})
+PASS: expectNotEqual(1.23, 4.56)
+PASS: expectNotEqual("abc", "def")
+PASS: expectNotEqual(null, undefined)
+PASS: expectNotEqual(NaN, NaN)
+PASS: expectNotEqual({}, {})
+PASS: expectNotEqual([], [])
+Expected to FAIL
+FAIL: expectNotEqual(true, true)
+FAIL: expectNotEqual({"a":1,"b":2}, {"a":1,"b":2})
+FAIL: expectNotEqual(1.23, 1.23)
+FAIL: expectNotEqual("abc", "abc")
+FAIL: expectNotEqual(null, null)
+FAIL: expectNotEqual(undefined, undefined)
+
+-- Running test case: InspectorTest.expectShallowEqual
+Expected to PASS
+PASS: expectShallowEqual({"a":1,"b":2}, {"a":1,"b":2})
+PASS: expectShallowEqual({}, {})
+PASS: expectShallowEqual([], [])
+Expected to FAIL
+FAIL: expectShallowEqual({"a":1,"b":2}, {"a":3,"b":4})
+FAIL: expectShallowEqual({}, [])
+
+-- Running test case: InspectorTest.expectNotShallowEqual
+Expected to PASS
+PASS: expectNotShallowEqual({"a":1,"b":2}, {"a":3,"b":4})
+PASS: expectNotShallowEqual({}, [])
+Expected to FAIL
+FAIL: expectNotShallowEqual({"a":1,"b":2}, {"a":1,"b":2})
+FAIL: expectNotShallowEqual({}, {})
+FAIL: expectNotShallowEqual([], [])
+
+-- Running test case: InspectorTest.expectEqualWithAccuracy
+Expected to PASS
+PASS: expectEqualWithAccuracy(0, 0, 0)
+PASS: expectEqualWithAccuracy(0, 0, 1)
+PASS: expectEqualWithAccuracy(0, 1, 1)
+PASS: expectEqualWithAccuracy(1, 0, 1)
+Expected to FAIL
+FAIL: expectEqualWithAccuracy(0, 2, 1)
+FAIL: expectEqualWithAccuracy(2, 0, 1)
+
+-- Running test case: InspectorTest.expectLessThan
+Expected to PASS
+PASS: expectLessThan(0, 1)
+PASS: expectLessThan("abc", "def")
+Expected to FAIL
+FAIL: expectLessThan(0, 0)
+FAIL: expectLessThan(1, 0)
+FAIL: expectLessThan("abc", "abc")
+FAIL: expectLessThan("def", "abc")
+
+-- Running test case: InspectorTest.expectLessThanOrEqual
+Expected to PASS
+PASS: expectLessThanOrEqual(0, 1)
+PASS: expectLessThanOrEqual(0, 0)
+PASS: expectLessThanOrEqual("abc", "def")
+PASS: expectLessThanOrEqual("abc", "abc")
+Expected to FAIL
+FAIL: expectLessThanOrEqual(1, 0)
+FAIL: expectLessThanOrEqual("def", "abc")
+
+-- Running test case: InspectorTest.expectGreaterThan
+Expected to PASS
+PASS: expectGreaterThan(1, 0)
+PASS: expectGreaterThan("def", "abc")
+Expected to FAIL
+FAIL: expectGreaterThan(0, 0)
+FAIL: expectGreaterThan(0, 1)
+FAIL: expectGreaterThan("abc", "abc")
+FAIL: expectGreaterThan("abc", "def")
+
+-- Running test case: InspectorTest.expectGreaterThanOrEqual
+Expected to PASS
+PASS: expectGreaterThanOrEqual(1, 0)
+PASS: expectGreaterThanOrEqual(0, 0)
+PASS: expectGreaterThanOrEqual("def", "abc")
+PASS: expectGreaterThanOrEqual("abc", "abc")
+Expected to FAIL
+FAIL: expectGreaterThanOrEqual(0, 1)
+FAIL: expectGreaterThanOrEqual("abc", "def")
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectorunitteststestharnessexpectfunctionshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/unit-tests/test-harness-expect-functions.html (0 => 205834)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/unit-tests/test-harness-expect-functions.html         (rev 0)
+++ trunk/LayoutTests/inspector/unit-tests/test-harness-expect-functions.html        2016-09-12 22:36:57 UTC (rev 205834)
</span><span class="lines">@@ -0,0 +1,190 @@
</span><ins>+<!doctype html>
+<html>
+<head>
+<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
+<script>
+function test()
+{
+ console.assert(false, "FAIL ASSERTION!!!!!!!");
+
+ let suite = InspectorTest.createSyncSuite("InspectorTestExpectFunctions");
+
+ function toArray(a) {
+ return a instanceof Array && a.length ? a : [a];
+ }
+
+ function stringifyArguments(args) {
+ return args.map((a) => {
+ if (typeof a === "number")
+ return a;
+ // Append empty string so `undefined` is displayed correctly.
+ return JSON.stringify(a) + "";
+ }).join(", ");
+ }
+
+ function addTestCase({functionName, passingInputs, failingInputs}) {
+ let functionUnderTest = InspectorTest[functionName];
+ InspectorTest.assert(typeof functionUnderTest === "function", "Unknown InspectorTest function: " + functionName);
+
+ suite.addTestCase({
+ name: `InspectorTest.${functionName}`,
+ test() {
+ function exerciseFunction(inputs, shouldPass) {
+ if (!inputs || !inputs.length) {
+ InspectorTest.fail("exerciseFunction called with no inputs.");
+ return;
+ }
+
+ InspectorTest.log("Expected to " + (shouldPass ? "PASS" : "FAIL"));
+ for (let input of inputs.map(toArray)) {
+ let argumentsString = stringifyArguments(input);
+ functionUnderTest.call(InspectorTest, ...input, `${functionName}(${argumentsString})`);
+ }
+ }
+
+ exerciseFunction(passingInputs, true);
+ exerciseFunction(failingInputs, false);
+ return true;
+ }
+ });
+ }
+
+ function addInverseTestCase(functionName, testCase) {
+ addTestCase({functionName, passingInputs: testCase.failingInputs, failingInputs: testCase.passingInputs})
+ }
+
+ let expectThatTestCase = {
+ functionName: "expectThat",
+ passingInputs: [true, 1, "abc", {}, []],
+ failingInputs: [false, 0, "", null, undefined, NaN],
+ };
+ addTestCase(expectThatTestCase);
+ addInverseTestCase("expectFalse", expectThatTestCase);
+
+ let expectNullTestCase = {
+ functionName: "expectNull",
+ passingInputs: [null],
+ failingInputs: [true, false, 1, "", undefined, {}, []]
+ };
+ addTestCase(expectNullTestCase);
+ addInverseTestCase("expectNotNull", expectNullTestCase);
+
+ let object1 = {a: 1, b: 2};
+ let object2 = {c: 3, d: 4};
+ let expectEqualTestCase = {
+ functionName: "expectEqual",
+ passingInputs: [
+ [true, true],
+ [object1, object1],
+ [1.23, 1.23],
+ ["abc", "abc"],
+ [null, null],
+ [undefined, undefined],
+ ],
+ failingInputs: [
+ [true, false],
+ [object1, object2],
+ [1.23, 4.56],
+ ["abc", "def"],
+ [null, undefined],
+ [NaN, NaN],
+ [{}, {}],
+ [[], []],
+ ]
+ };
+ addTestCase(expectEqualTestCase);
+ addInverseTestCase("expectNotEqual", expectEqualTestCase);
+
+ let expectShallowEqualTestCase = {
+ functionName: "expectShallowEqual",
+ passingInputs: [
+ [{a: 1, b: 2}, {a: 1, b: 2}],
+ [{}, {}],
+ [[], []],
+ ],
+ failingInputs: [
+ [{a: 1, b: 2}, {a: 3, b: 4}],
+ [{}, []],
+ ]
+ };
+ addTestCase(expectShallowEqualTestCase);
+ addInverseTestCase("expectNotShallowEqual", expectShallowEqualTestCase);
+
+ addTestCase({
+ functionName: "expectEqualWithAccuracy",
+ passingInputs: [
+ [0, 0, 0],
+ [0, 0, 1],
+ [0, 1, 1],
+ [1, 0, 1],
+ ],
+ failingInputs: [
+ [0, 2, 1],
+ [2, 0, 1],
+ ]
+ });
+
+ addTestCase({
+ functionName: "expectLessThan",
+ passingInputs: [
+ [0, 1],
+ ["abc", "def"],
+ ],
+ failingInputs: [
+ [0, 0],
+ [1, 0],
+ ["abc", "abc"],
+ ["def", "abc"],
+ ]
+ });
+
+ addTestCase({
+ functionName: "expectLessThanOrEqual",
+ passingInputs: [
+ [0, 1],
+ [0, 0],
+ ["abc", "def"],
+ ["abc", "abc"],
+ ],
+ failingInputs: [
+ [1, 0],
+ ["def", "abc"],
+ ]
+ });
+
+ addTestCase({
+ functionName: "expectGreaterThan",
+ passingInputs: [
+ [1, 0],
+ ["def", "abc"],
+ ],
+ failingInputs: [
+ [0, 0],
+ [0, 1],
+ ["abc", "abc"],
+ ["abc", "def"],
+ ]
+ });
+
+ addTestCase({
+ functionName: "expectGreaterThanOrEqual",
+ passingInputs: [
+ [1, 0],
+ [0, 0],
+ ["def", "abc"],
+ ["abc", "abc"],
+ ],
+ failingInputs: [
+ [0, 1],
+ ["abc", "def"],
+ ]
+ });
+
+ suite.runTestCasesAndFinish();
+}
+</script>
+</head>
+<body onload="runTest()">
+ <p>Testing TestHarness.expect* family of functions.</p>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (205833 => 205834)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2016-09-12 22:36:14 UTC (rev 205833)
+++ trunk/Source/WebInspectorUI/ChangeLog        2016-09-12 22:36:57 UTC (rev 205834)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2016-09-12 Matt Baker <mattbaker@apple.com>
+
+ Web Inspector: Improve clarity of inspector tests by adding TestHarness.expect* functions similar to XCTest
+ https://bugs.webkit.org/show_bug.cgi?id=161278
+ <rdar://problem/28039741>
+
+ Reviewed by Joseph Pecoraro.
+
+ Under the hood they all call TestHarness.expectThat.
+
+ * UserInterface/Test/TestHarness.js:
+ (TestHarness.prototype.expectFalse):
+ (TestHarness.prototype.expectNull):
+ (TestHarness.prototype.expectNotNull):
+ (TestHarness.prototype.expectEqual):
+ (TestHarness.prototype.expectNotEqual):
+ (TestHarness.prototype.expectShallowEqual):
+ (TestHarness.prototype.expectNotShallowEqual):
+ (TestHarness.prototype.expectEqualWithAccuracy):
+ (TestHarness.prototype.expectLessThan):
+ (TestHarness.prototype.expectLessThanOrEqual):
+ (TestHarness.prototype.expectGreaterThan):
+ (TestHarness.prototype.expectGreaterThanOrEqual):
+
</ins><span class="cx"> 2016-09-12 Nikita Vasilyev <nvasilyev@apple.com>
</span><span class="cx">
</span><span class="cx"> REGRESSION (r205223): Web Inspector: Debugger popover title and code aren't horizontally aligned
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTestTestHarnessjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Test/TestHarness.js (205833 => 205834)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Test/TestHarness.js        2016-09-12 22:36:14 UTC (rev 205833)
+++ trunk/Source/WebInspectorUI/UserInterface/Test/TestHarness.js        2016-09-12 22:36:57 UTC (rev 205834)
</span><span class="lines">@@ -99,6 +99,68 @@
</span><span class="cx"> this.fail(message);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ expectFalse(expression, message)
+ {
+ this.expectThat(!expression, message);
+ }
+
+ expectNull(expression, message)
+ {
+ this.expectThat(expression === null, message);
+ }
+
+ expectNotNull(expression, message)
+ {
+ this.expectThat(expression !== null, message);
+ }
+
+ expectEqual(expression1, expression2, message)
+ {
+ this.expectThat(expression1 === expression2, message);
+ }
+
+ expectNotEqual(expression1, expression2, message)
+ {
+ this.expectThat(expression1 !== expression2, message);
+ }
+
+ expectShallowEqual(expression1, expression2, message)
+ {
+ this.expectThat(Object.shallowEqual(expression1, expression2), message);
+ }
+
+ expectNotShallowEqual(expression1, expression2, message)
+ {
+ this.expectThat(!Object.shallowEqual(expression1, expression2), message);
+ }
+
+ expectEqualWithAccuracy(expression1, expression2, accuracy, message)
+ {
+ console.assert(typeof expression1 === "number");
+ console.assert(typeof expression2 === "number");
+ this.expectThat(Math.abs(expression1 - expression2) <= accuracy, message);
+ }
+
+ expectLessThan(expression1, expression2, message)
+ {
+ this.expectThat(expression1 < expression2, message);
+ }
+
+ expectLessThanOrEqual(expression1, expression2, message)
+ {
+ this.expectThat(expression1 <= expression2, message);
+ }
+
+ expectGreaterThan(expression1, expression2, message)
+ {
+ this.expectThat(expression1 > expression2, message);
+ }
+
+ expectGreaterThanOrEqual(expression1, expression2, message)
+ {
+ this.expectThat(expression1 >= expression2, message);
+ }
+
</ins><span class="cx"> pass(message)
</span><span class="cx"> {
</span><span class="cx"> let stringifiedMessage = TestHarness.messageAsString(message);
</span></span></pre>
</div>
</div>
</body>
</html>