@@ -73,7 +73,7 @@ testList :: Test
73testList = TestList [testADT1, testADT2, testADT3, testADT4, testADT6, testADT7, testADT8]
73testList = TestList [testADT1, testADT2, testADT3, testADT4, testADT6, testADT7, testADT8]
75testADT1 :: Test
75testADT1 :: Test
76−testADT1 = TestCase $ assertEqual "one record constructor" example (fromTuple (toTuple example))
76+testADT1 = TestCase $ assertEqual "one record constructor" (Right example) (fromTuple (toTuple example))
78 example = Test1C {attrA = 3}
78 example = Test1C {attrA = 3}
@@ -81,7 +81,7 @@ testADT1 = TestCase $ assertEqual "one record constructor" example (fromTuple (t
81testADT2 :: Test
81testADT2 :: Test
82testADT2 = TestCase $ do
82testADT2 = TestCase $ do
83 let example = Test2C { attrB = 4, attrC = 6 }
83 let example = Test2C { attrB = 4, attrC = 6 }
84− assertEqual "two record constructor" example (fromTuple (toTuple example))
84+ assertEqual "two record constructor" (Right example) (fromTuple (toTuple example))
85 --this was a tricky case that was throwing the undefined exception because of insufficient laziness in the :*: matching- see ProjectM36.Tupleable
85 --this was a tricky case that was throwing the undefined exception because of insufficient laziness in the :*: matching- see ProjectM36.Tupleable
86 let expectedAttributes = attributesFromList [Attribute "attrB" IntAtomType,
86 let expectedAttributes = attributesFromList [Attribute "attrB" IntAtomType,
87 Attribute "attrC" IntAtomType]
87 Attribute "attrC" IntAtomType]
@@ -89,30 +89,30 @@ testADT2 = TestCase $ do
91testADT3 :: Test
91testADT3 :: Test
92−testADT3 = TestCase $ assertEqual "one arg constructor" example (fromTuple (toTuple example))
92+testADT3 = TestCase $ assertEqual "one arg constructor" (Right example) (fromTuple (toTuple example))
94 example = Test3C 4
94 example = Test3C 4
96testADT4 :: Test
96testADT4 :: Test
97−testADT4 = TestCase $ assertEqual "zero arg constructor" example (fromTuple (toTuple example))
97+testADT4 = TestCase $ assertEqual "zero arg constructor" (Right example) (fromTuple (toTuple example))
99 example = Test4C
99 example = Test4C
101--testADT5 should not compile
101--testADT5 should not compile
103testADT6 :: Test
103testADT6 :: Test
104−testADT6 = TestCase $ assertEqual "mixed types" example (fromTuple (toTuple example))
104+testADT6 = TestCase $ assertEqual "mixed types" (Right example) (fromTuple (toTuple example))
106 example = Test6C "testo" 3 4.0
106 example = Test6C "testo" 3 4.0
108testADT7 :: Test
108testADT7 :: Test
109testADT7 = TestCase $ do
109testADT7 = TestCase $ do
110 let example = Test7C (Test7AC 3)
110 let example = Test7C (Test7AC 3)
111− assertEqual "atom type" example (fromTuple (toTuple example))
111+ assertEqual "atom type" (Right example) (fromTuple (toTuple example))
112 let expectedAttrs = V.singleton (Attribute "" (ConstructedAtomType "Test7A" M.empty))
112 let expectedAttrs = V.singleton (Attribute "" (ConstructedAtomType "Test7A" M.empty))
113 assertEqual "adt atomtype" expectedAttrs (toAttributes (undefined :: Test7T))
113 assertEqual "adt atomtype" expectedAttrs (toAttributes (undefined :: Test7T))
115testADT8 :: Test
115testADT8 :: Test
116−testADT8 = TestCase $ assertEqual "single value" example (fromTuple (toTuple example))
116+testADT8 = TestCase $ assertEqual "single value" (Right example) (fromTuple (toTuple example))
118 example = Test8C
118 example = Test8C