Skip to content

Commit

Permalink
Generated tests for refactoring (IIFE/async function).then(\$DONE, \$…
Browse files Browse the repository at this point in the history
…DONE); to use asyncTest
  • Loading branch information
cjtenny authored and ptomato committed Feb 21, 2023
1 parent 4d9d5c5 commit 4fe158d
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description: Reassignment of function name is silently ignored in non-strict mod
esid: sec-async-function-definitions
features: [async-functions]
flags: [generated, async, noStrict]
includes: [asyncHelpers.js]
info: |
Async Function Definitions
Expand All @@ -24,8 +25,8 @@ let ref = async function BindingIdentifier() {
return BindingIdentifier;
};

(async () => {
asyncTest(async () => {
assert.sameValue(await ref(), ref);
assert.sameValue(callCount, 1, 'function invoked exactly once');
})().then($DONE, $DONE);
});

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description: Reassignment of function name is silently ignored in non-strict mod
esid: sec-async-function-definitions
features: [async-functions]
flags: [generated, async, noStrict]
includes: [asyncHelpers.js]
info: |
Async Function Definitions
Expand All @@ -22,8 +23,8 @@ let ref = async function BindingIdentifier() {
return BindingIdentifier;
};

(async () => {
asyncTest(async () => {
assert.sameValue(await ref(), ref);
assert.sameValue(callCount, 1, 'function invoked exactly once');
})().then($DONE, $DONE);
});

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description: Reassignment of function name is silently ignored in non-strict mod
esid: sec-async-function-definitions
features: [async-functions]
flags: [generated, async, noStrict]
includes: [asyncHelpers.js]
info: |
Async Function Definitions
Expand All @@ -22,8 +23,8 @@ let ref = async function BindingIdentifier() {
return BindingIdentifier;
};

(async () => {
asyncTest(async () => {
assert.sameValue(await ref(), ref);
assert.sameValue(callCount, 1, 'function invoked exactly once');
})().then($DONE, $DONE);
});

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description: Reassignment of function name is silently ignored in non-strict mod
esid: sec-async-function-definitions
features: [async-functions]
flags: [generated, async, onlyStrict]
includes: [asyncHelpers.js]
info: |
Async Function Definitions
Expand All @@ -24,7 +25,7 @@ let ref = async function BindingIdentifier() {
return BindingIdentifier;
};

(async () => {
asyncTest(async () => {
let catchCount = 0;
try {
await ref()
Expand All @@ -34,5 +35,5 @@ let ref = async function BindingIdentifier() {
}
assert.sameValue(catchCount, 1);
assert.sameValue(callCount, 1);
})().then($DONE, $DONE);
});

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description: Reassignment of function name is silently ignored in non-strict mod
esid: sec-async-function-definitions
features: [async-functions]
flags: [generated, async, onlyStrict]
includes: [asyncHelpers.js]
info: |
Async Function Definitions
Expand All @@ -22,7 +23,7 @@ let ref = async function BindingIdentifier() {
return BindingIdentifier;
};

(async () => {
asyncTest(async () => {
let catchCount = 0;
try {
await ref()
Expand All @@ -32,5 +33,5 @@ let ref = async function BindingIdentifier() {
}
assert.sameValue(catchCount, 1);
assert.sameValue(callCount, 1);
})().then($DONE, $DONE);
});

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description: Reassignment of function name is silently ignored in non-strict mod
esid: sec-async-function-definitions
features: [async-functions]
flags: [generated, async, onlyStrict]
includes: [asyncHelpers.js]
info: |
Async Function Definitions
Expand All @@ -22,7 +23,7 @@ let ref = async function BindingIdentifier() {
return BindingIdentifier;
};

(async () => {
asyncTest(async () => {
let catchCount = 0;
try {
await ref()
Expand All @@ -32,5 +33,5 @@ let ref = async function BindingIdentifier() {
}
assert.sameValue(catchCount, 1);
assert.sameValue(callCount, 1);
})().then($DONE, $DONE);
});

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description: Reassignment of function name is silently ignored in non-strict mod
esid: sec-asyncgenerator-definitions-evaluation
features: [async-iteration]
flags: [generated, async, noStrict]
includes: [asyncHelpers.js]
info: |
AsyncGeneratorExpression :
async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
Expand All @@ -22,8 +23,8 @@ let ref = async function * BindingIdentifier() {
return BindingIdentifier;
};

(async () => {
asyncTest(async () => {
assert.sameValue((await (await ref()).next()).value, ref);
assert.sameValue(callCount, 1, 'function invoked exactly once');
})().then($DONE, $DONE);
});

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description: Reassignment of function name is silently ignored in non-strict mod
esid: sec-asyncgenerator-definitions-evaluation
features: [async-iteration]
flags: [generated, async, noStrict]
includes: [asyncHelpers.js]
info: |
AsyncGeneratorExpression :
async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
Expand All @@ -20,8 +21,8 @@ let ref = async function * BindingIdentifier() {
return BindingIdentifier;
};

(async () => {
asyncTest(async () => {
assert.sameValue((await (await ref()).next()).value, ref);
assert.sameValue(callCount, 1, 'function invoked exactly once');
})().then($DONE, $DONE);
});

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description: Reassignment of function name is silently ignored in non-strict mod
esid: sec-asyncgenerator-definitions-evaluation
features: [async-iteration]
flags: [generated, async, noStrict]
includes: [asyncHelpers.js]
info: |
AsyncGeneratorExpression :
async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
Expand All @@ -20,8 +21,8 @@ let ref = async function * BindingIdentifier() {
return BindingIdentifier;
};

(async () => {
asyncTest(async () => {
assert.sameValue((await (await ref()).next()).value, ref);
assert.sameValue(callCount, 1, 'function invoked exactly once');
})().then($DONE, $DONE);
});

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description: Reassignment of function name is silently ignored in non-strict mod
esid: sec-asyncgenerator-definitions-evaluation
features: [async-iteration]
flags: [generated, async, onlyStrict]
includes: [asyncHelpers.js]
info: |
AsyncGeneratorExpression :
async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
Expand All @@ -22,7 +23,7 @@ let ref = async function * BindingIdentifier() {
return BindingIdentifier;
};

(async () => {
asyncTest(async () => {
let catchCount = 0;
try {
(await (await ref()).next()).value
Expand All @@ -32,5 +33,5 @@ let ref = async function * BindingIdentifier() {
}
assert.sameValue(catchCount, 1);
assert.sameValue(callCount, 1);
})().then($DONE, $DONE);
});

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description: Reassignment of function name is silently ignored in non-strict mod
esid: sec-asyncgenerator-definitions-evaluation
features: [async-iteration]
flags: [generated, async, onlyStrict]
includes: [asyncHelpers.js]
info: |
AsyncGeneratorExpression :
async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
Expand All @@ -20,7 +21,7 @@ let ref = async function * BindingIdentifier() {
return BindingIdentifier;
};

(async () => {
asyncTest(async () => {
let catchCount = 0;
try {
(await (await ref()).next()).value
Expand All @@ -30,5 +31,5 @@ let ref = async function * BindingIdentifier() {
}
assert.sameValue(catchCount, 1);
assert.sameValue(callCount, 1);
})().then($DONE, $DONE);
});

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description: Reassignment of function name is silently ignored in non-strict mod
esid: sec-asyncgenerator-definitions-evaluation
features: [async-iteration]
flags: [generated, async, onlyStrict]
includes: [asyncHelpers.js]
info: |
AsyncGeneratorExpression :
async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
Expand All @@ -20,7 +21,7 @@ let ref = async function * BindingIdentifier() {
return BindingIdentifier;
};

(async () => {
asyncTest(async () => {
let catchCount = 0;
try {
(await (await ref()).next()).value
Expand All @@ -30,5 +31,5 @@ let ref = async function * BindingIdentifier() {
}
assert.sameValue(catchCount, 1);
assert.sameValue(callCount, 1);
})().then($DONE, $DONE);
});

0 comments on commit 4fe158d

Please sign in to comment.