blob: 1aea73f9726237ce6c2fc879d733fe80461e769e [file] [log] [blame]
drousso@apple.combc0630f2020-10-17 04:34:26 +00001<!doctype html>
2<html>
3<head>
4<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
5<script>
6function test()
7{
8 let suite = InspectorTest.createSyncSuite("Utilities");
9
10 suite.addTestCase({
11 name: "xor",
12 test() {
13 InspectorTest.expectEqual(xor(0, undefined), false, "xor should explicitly return false when both values are falsy.");
14 InspectorTest.expectEqual(xor(42, undefined), 42, "xor should return the first value when the second value is falsy.");
15 InspectorTest.expectEqual(xor(undefined, "test"), "test", "xor should return the second value when the first value is falsy.");
16 InspectorTest.expectEqual(xor(42, "test"), false, "xor should explicitly return false when both values are truthy.");
17 },
18 });
19
20 suite.runTestCasesAndFinish();
21}
22</script>
23</head>
24<body onLoad="runTest()">
25</body>
26</html>