diff --git a/test/CaseSplitSpec.hs b/test/CaseSplitSpec.hs index 5e5db3f..4cec78b 100644 --- a/test/CaseSplitSpec.hs +++ b/test/CaseSplitSpec.hs @@ -39,3 +39,8 @@ spec = do res `shouldBe` "38 21 38 59"++ " \"mlReverse' Nil accum = _mlReverse_body\NUL"++ " mlReverse' (Cons xs'1 xs'2) accum = _mlReverse_body\"\n" + + it "doesn't crash when source doesn't make sense" $ + withDirectory_ "test/data/case-split" $ do + res <- runD $ splits "Crash.hs" 4 6 + res `shouldBe` [] diff --git a/test/data/case-split/Crash.hs b/test/data/case-split/Crash.hs new file mode 100644 index 0000000..7ee88cb --- /dev/null +++ b/test/data/case-split/Crash.hs @@ -0,0 +1,4 @@ +module Crash where + +test :: Maybe a +test x = undefined