Commit cd565b22 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Add pretty-print test

parent cdd2c62c
...@@ -162,3 +162,4 @@ test('tcfail173', normal, compile_fail, ['']) ...@@ -162,3 +162,4 @@ test('tcfail173', normal, compile_fail, [''])
test('tcfail174', normal, compile_fail, ['']) test('tcfail174', normal, compile_fail, [''])
test('tcfail175', normal, compile_fail, ['']) test('tcfail175', normal, compile_fail, [''])
test('tcfail176', normal, compile_fail, ['']) test('tcfail176', normal, compile_fail, [''])
test('tcfail177', normal, compile_fail, [''])
module ShouldFail where
-- This is really a pretty-printer test, not a typechecker test
-- The more infix ops we have, the worse fsep works
allTests :: Bool
allTests = foo
[a ~?= b
,"Three" ~?= "3"
,"Four" ~?= "4"
,"Five" ~?= "5"
,"Five" ~?= "5"
,"Five" ~?= "5"
,"Five" ~?= "5"
,"Five" ~?= "5"
,"Five" ~?= "5"
,"Two", "Two", "Two"
,"Two", "Two", "Two"
,"Two", "Two", "Two"
,"Two", "Two", "Two"
,"Two", "Two", "Two"
,"Two", "Two", "Two"]
a=""
b=""
(~?=) :: a -> a -> Bool
(~?=) = error "urk"
foo :: a -> Int
foo x = 0
*** Buggy output has incorrect indentation, but test harness discards
*** white space, so doesn't show it up. Hence this message, to force
*** it to fail until we fix the bug.
tcfail177.hs:17:12:
Couldn't match expected type `Bool' against inferred type `[Char]'
In the expression: "Two"
In the first argument of `foo', namely
`[a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5",
"Five" ~?= "5", "Five" ~?= "5", "Five" ~?= "5",
"Five" ~?= "5", "Five" ~?= "5", "Two", "Two", "Two",
"Two", "Two", "Two", "Two", "Two", "Two", "Two", "Two",
"Two", "Two", "Two", "Two", "Two", "Two", "Two"]'
In the expression:
foo
[a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5",
"Five" ~?= "5", "Five" ~?= "5", "Five" ~?= "5",
"Five" ~?= "5", "Five" ~?= "5", "Two", "Two", "Two",
"Two", "Two", "Two", "Two", "Two", "Two", "Two", "Two",
"Two", "Two", "Two", "Two", "Two", "Two", "Two"]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment