Closed Tritlo closed 3 years ago
This adds hole fits of the type (_ xs) where xs is some part of the target. E.g
(_ xs)
xs
module Wrap where onlyGoodOnes :: [Int] -> [Int] onlyGoodOnes = filter even xs :: [Int] xs = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] prop_allEven :: Bool prop_allEven = all even xs && not (null xs) ---- EXPECTED ---- -- diff --git a/tests/cases/Wrap.hs b/tests/cases/Wrap.hs -- --- a/tests/cases/Wrap.hs -- +++ b/tests/cases/Wrap.hs -- @@ -7,1 +7,1 @@ xs = [1, 2, 3, 4, 5, 6, 7, 8, ... -- -xs = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] -- +xs = ((filter even) ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])) -- -- diff --git a/tests/cases/Wrap.hs b/tests/cases/Wrap.hs -- --- a/tests/cases/Wrap.hs -- +++ b/tests/cases/Wrap.hs -- @@ -7,1 +7,1 @@ xs = [1, 2, 3, 4, 5, 6, 7, 8, ... -- -xs = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] -- +xs = (onlyGoodOnes ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])) ---- END EXPECTED ----
Since adding a filter or check at the end is a very common fix, I think this will allow us to fix a lot more program.s
This adds hole fits of the type
(_ xs)
wherexs
is some part of the target. E.gSince adding a filter or check at the end is a very common fix, I think this will allow us to fix a lot more program.s