Skip to content

Add inspection tests to Replicator.elim and V.{make,elim}#367

Merged
tbagrel1 merged 2 commits intomasterfrom
tbagrel1/inspection-testing-make-elim
Feb 10, 2022
Merged

Add inspection tests to Replicator.elim and V.{make,elim}#367
tbagrel1 merged 2 commits intomasterfrom
tbagrel1/inspection-testing-make-elim

Conversation

@tbagrel1
Copy link
Copy Markdown
Member

@tbagrel1 tbagrel1 commented Feb 7, 2022

Replicator.elim, V.make, and V.elim are implemented with classes so as to enable inlining. With inspection testing, we need to ensure that their final Core form are the same as a manually unrolled recursion.

@tbagrel1 tbagrel1 marked this pull request as ready for review February 9, 2022 14:21
@tbagrel1 tbagrel1 requested a review from aspiwack February 9, 2022 14:54
@tbagrel1
Copy link
Copy Markdown
Member Author

tbagrel1 commented Feb 9, 2022

For consistency, I added INLINABLE pragmas on every function that should either be inlined in both {elim,make} and manual{Elim,Make}, or not inlined in both contexts.

test/Main.hs Outdated
Comment on lines +29 to +30
vInspectionTests,
replicatorInspectionTests
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Divide this list in two testGroups one for data structure tests, and one for inspection tests.

[$(inspectTest $ 'elim3 === 'manualElim3)]

elim3 :: (a %1 -> a %1 -> a %1 -> [a]) %1 -> Replicator a %1 -> [a]
elim3 f r = Replicator.elim f r
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Next PR, let's make sure that we can remove the f and the r and still have the inspection test pass.

Tests are now split into "Functional" and "Inspection" groups
@tbagrel1 tbagrel1 force-pushed the tbagrel1/inspection-testing-make-elim branch 2 times, most recently from 14ccb7e to 7bfd57f Compare February 10, 2022 15:19
@tbagrel1 tbagrel1 force-pushed the tbagrel1/inspection-testing-make-elim branch from 7bfd57f to 83b9184 Compare February 10, 2022 15:20
@tbagrel1 tbagrel1 merged commit 409c49f into master Feb 10, 2022
@tbagrel1 tbagrel1 deleted the tbagrel1/inspection-testing-make-elim branch February 10, 2022 16:36
@tbagrel1 tbagrel1 mentioned this pull request Feb 11, 2022
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