drousso@apple.com | bc0630f | 2020-10-17 04:34:26 +0000 | [diff] [blame] | 1 | <!doctype html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <script src="../../http/tests/inspector/resources/inspector-test.js"></script> |
| 5 | <script> |
| 6 | function 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> |