mirror of
https://github.com/iritmaximus/haskell.git
synced 2026-10-12 19:13:39 +03:00
Set 5a: better error message for weird constructors
This commit is contained in:
@@ -32,7 +32,7 @@ tests = [(1,"Vehicle",[ex1])
|
||||
-- -- -- -- -- -- -- --
|
||||
|
||||
assertNormalConstructor (Constructor _ _) = property True
|
||||
assertNormalConstructor (Weird n) = counterexample (" constructor "++n++" is weird. Make it normal.") False
|
||||
assertNormalConstructor (Weird n) = counterexample (" constructor "++n++" is not a normal constructor. Perhaps it's a record constructor or an infix constructor? Make it normal.") False
|
||||
|
||||
assertNoFields (Constructor n vs) = counterexample (" constructor "++n++" should have no fields") $ null vs
|
||||
assertNoFields _ = property True
|
||||
|
||||
Reference in New Issue
Block a user