Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-format destructuring assignment tests #651

Merged
merged 2 commits into from
Jun 1, 2016

Conversation

jugglinmike
Copy link
Contributor

Utilize the test generation tool to increase coverage of destructuring
assignment semantics. Previously, only destructuring assignment in the
AssignmentExpression position was tested. With this change applied, the
same tests will assert expected behavior for destructuring assignment in
for..of statements, as well.

A limited number of tests are applied to the for..in statement as
well, but due to the iteration protocol observed by that statement, many
destructuring tests are not relevant, and others cannot be automatically
generated from this format.


This may be surprising, but extending coverage in this way actually caches more
bugs in real engines!

A recent build of SpiderMonkey has this pass rate for the destructuring
assignment tests in master right now:

Passed 327 tests (73.8%) / Failed 116 tests (26.2%)

...but that is limited to usage from the AssignmentExpression production.

This patch uses the test generation tool to create equivalent tests for
destructuring assignment from the head of a for-of statement. SpiderMonkey
has the following pass rate for those tests:

Passed 307 tests (69.3%) / Failed 136 tests (30.7%)

Utilize the test generation tool to increase coverage of destructuring
assignment semantics. Previously, only destructuring assignment in the
AssignmentExpression position was tested. With this change applied, the
same tests will assert expected behavior for destructuring assignment in
`for..of` statements, as well.

A limited number of tests are applied to the `for..in` statement as
well, but due to the iteration protocol observed by that statement, many
destructuring tests are not relevant, and others cannot be automatically
generated from this format.
@leobalter leobalter merged commit 2cf968c into tc39:master Jun 1, 2016
@leobalter
Copy link
Member

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants