-
Notifications
You must be signed in to change notification settings - Fork 211
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
Low test coverage of normalizeWithM #1114
Comments
Ah, no. It's probably something like |
@sjakobi: We really only need one test, which is just a property test that ensures that |
sjakobi
added a commit
that referenced
this issue
Jul 16, 2019
sjakobi
added a commit
that referenced
this issue
Jul 18, 2019
* Implements constant folding of Natural/fold applications normalizeWithM. * Changes the Arbitrary Var instance to generate only non-negative indices. Otherwise failures like this one would pop up: normalizeWithM should be consistent with normalize: FAIL (8.51s) *** Failed! Falsified (after 318133 tests and 6 shrinks): Let (Binding {variable = "", annotation = Nothing, value = List} :| []) (Var (V "" (-1))) Var (V "" (-1)) /= Var (V "" (-2)) Use --quickcheck-replay=180244 to reproduce. Fixes #1114.
mergify bot
pushed a commit
that referenced
this issue
Jul 19, 2019
* Check normalizeWithM for consistency with normalize * Implements constant folding of Natural/fold applications normalizeWithM. * Changes the Arbitrary Var instance to generate only non-negative indices. Otherwise failures like this one would pop up: normalizeWithM should be consistent with normalize: FAIL (8.51s) *** Failed! Falsified (after 318133 tests and 6 shrinks): Let (Binding {variable = "", annotation = Nothing, value = List} :| []) (Var (V "" (-1))) Var (V "" (-1)) /= Var (V "" (-2)) Use --quickcheck-replay=180244 to reproduce. Fixes #1114. * QuickCheck tests: Specialize the 'natural' Gen to Naturals Previously it could produce about any number, not just non-negative ones.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If I wrap the entire implementation of
Dhall.Core.normalizeWithM
with anundefined
, only 8 tests fail:If I insert
undefined
s in just some of theExpr
alternatives, the testsuite isn't affected at all.Given that we have some fairly complex logic in
normalizeWithM
, I wonder whether some of it is already broken.To increase test coverage, could we simply run the normalization tests through
normalizeWithM
too? The "trivial"Normalizer
appears to be simply(Identity . Just)
.A assume we cannot simply get rid of
normalizeWithM
because someone's actually using it?!The text was updated successfully, but these errors were encountered: