mirror of
https://github.com/tc39/test262.git
synced 2025-05-04 06:50:32 +02:00
12 lines
521 B
JavaScript
12 lines
521 B
JavaScript
function shouldBe(actual, expected) {
|
|
if (actual !== expected)
|
|
throw new Error('bad value: ' + actual);
|
|
}
|
|
|
|
shouldBe((function test() { }).toString(), `function test() { }`);
|
|
shouldBe((() => { }).toString(), `() => { }`);
|
|
shouldBe((function* test() { }).toString(), `function* test() { }`);
|
|
shouldBe((async function* test() { }).toString(), `async function* test() { }`);
|
|
shouldBe((async function test() { }).toString(), `async function test() { }`);
|
|
shouldBe((async () => { }).toString(), `async () => { }`);
|