Skip to content

Commit

Permalink
[Tests] increase coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Apr 6, 2024
1 parent 8211080 commit 10dff5c
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -16135,6 +16135,31 @@ var es2024 = function ES2024(ES, ops, expectedMissing, skips) {
st.end();
});

t.test('conflated sentinel value', function (st) {
var i = 0;
var iterator = {
next: function next(x) {
try {
return {
done: i > 2,
value: i > 0 ? i : 'DONE'
};
} finally {
i += 1;
}
}
};
var syncIteratorRecord = makeIteratorRecord(iterator);

st.deepEqual(ES.IteratorStepValue(syncIteratorRecord), 'DONE', 'first yield');
st.deepEqual(ES.IteratorStepValue(syncIteratorRecord), 1, 'second yield');
st.deepEqual(ES.IteratorStepValue(syncIteratorRecord), 2, 'third yield');
st.deepEqual(ES.IteratorStepValue(syncIteratorRecord), 'DONE', 'fourth yield');
st.deepEqual(ES.IteratorStepValue(syncIteratorRecord), 'DONE', 'fifth yield');

st.end();
});

t.end();
});

Expand Down

0 comments on commit 10dff5c

Please sign in to comment.