@@ -1,24 +1,46 @@
11module Tests.Property where
22
33import Test.Framework
4+import Test.Framework.Providers.HUnit
45import Test.Framework.Providers.QuickCheck2
6+import Test.HUnit (assert)
57import Test.QuickCheck
68
7−import SourceSyntax.Literal (Literal)
8−import SourceSyntax.PrettyPrint (Pretty, pretty)
9−import Parse.Helpers (IParser, iParse)
10−import Parse.Literal (literal)
11−import Parse.Pattern (expr)
9+import SourceSyntax.Literal as Lit
10+import SourceSyntax.Pattern as Pat
11+import SourceSyntax.PrettyPrint (Pretty, pretty)
12+import Parse.Helpers (IParser, iParse)
13+import Parse.Literal (literal)
14+import Parse.Pattern (expr)
1215import Tests.Property.Arbitrary
1316
1417propertyTests :: Test
1518propertyTests =
1619 testGroup "Parse/Print Agreement Tests"
1720 [
18− testProperty "Literal test" $ prop_parse_print literal
21+ testCase "Long Pattern test" $ assert (prop_parse_print expr longPat)
22+ , testProperty "Literal test" $ prop_parse_print literal
1923 , testProperty "Pattern test" $ prop_parse_print expr
2024 ]
2125
26+ where
27+ -- This test was autogenerated from the Pattern test and should be
28+ -- left in all its ugly glory.
29+ longPat = Pat.PData "I" [ Pat.PLiteral (Lit.Chr '+')
30+ , Pat.PRecord [
31+ "q7yclkcm7k_ikstrczv_"
32+ , "wQRv6gKsvvkjw4b5F"
33+ ,"c9'eFfhk9FTvsMnwF_D"
34+ ,"yqxhEkHvRFwZ"
35+ ,"o"
36+ ,"nbUlCn3y3NnkVoxhW"
37+ ,"iJ0MNy3KZ_lrs"
38+ ,"ug"
39+ ,"sHHsX"
40+ ,"mRKs9d"
41+ ,"o2KiCX5'ZRzHJfRi8" ]
42+ , Pat.PVar "su'BrrbPUK6I33Eq" ]
43+
2244prop_parse_print :: (Pretty a, Arbitrary a, Eq a) => IParser a -> a -> Bool
2345prop_parse_print p x =
2446 either (const False) (== x) . parse_print p $ x