Skip to content

Preserve sparse array shape in operator replay tests - #660

Draft
CaelmBleidd wants to merge 1 commit into
caelmbleidd/ts-preserve-sparse-array-witnessesfrom
caelmbleidd/ts-sparse-property-test-replay
Draft

CaelmBleidd wants to merge 1 commit into
caelmbleidd/ts-preserve-sparse-array-witnessesfrom
caelmbleidd/ts-sparse-property-test-replay

Conversation

@CaelmBleidd

Copy link
Copy Markdown
Member

The operator tests replay before/after snapshots in Node. The previous helper filled every missing array slot with an own undefined and compared only enumerable keys, which could accept returned arrays with a different length. It also allocated a new array for each reference.

Emit arrays at their recorded length, define only existing slots, and preserve object identities. The comparison records already paired objects, array lengths and corresponding own keys. The new source tests check a sparse array reused across two parameters and reject both a wrong output length and a falsely shared return object.

Review after #640, which introduces the sparse witness representation.

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.

1 participant