diff --git a/src/Grisette/Core/Data/Union.hs b/src/Grisette/Core/Data/Union.hs index 91b4f4d8..87185ced 100644 --- a/src/Grisette/Core/Data/Union.hs +++ b/src/Grisette/Core/Data/Union.hs @@ -81,16 +81,16 @@ data Union a UnionSingle a | -- | A if value UnionIf - -- | Cached leftmost value a - -- | Is merged invariant already maintained? + -- ^ Cached leftmost value !Bool - -- | If condition + -- ^ Is merged invariant already maintained? !SymBool - -- | True branch + -- ^ If condition (Union a) - -- | False branch + -- ^ True branch (Union a) + -- ^ False branch deriving (Generic, Eq, Lift, Generic1) instance Eq1 Union where diff --git a/test/Grisette/Core/Control/Monad/UnionMTests.hs b/test/Grisette/Core/Control/Monad/UnionMTests.hs index 6ecd39c8..9eebaf43 100644 --- a/test/Grisette/Core/Control/Monad/UnionMTests.hs +++ b/test/Grisette/Core/Control/Monad/UnionMTests.hs @@ -144,10 +144,10 @@ unionMTests = let v :: UnionM Integer = mrgIf "b" (mrgSingle 1) (mrgSingle 3) f <*> v - @?= unionIf - "a" - (unionIf "b" (single 1) (single 3)) - (unionIf "b" (single 2) (single 4)) + @?= unionIf + "a" + (unionIf "b" (single 1) (single 3)) + (unionIf "b" (single 2) (single 4)) ], testGroup "Monad" @@ -624,24 +624,24 @@ unionMTests = testCase "plus" $ (mrgIf "a" (mrgSingle 0) (mrgSingle 1) :: UnionM Integer) + mrgIf "b" (mrgSingle 1) (mrgSingle 3) - @?= mrgIf - "a" - (mrgIf "b" (mrgSingle 1) (mrgSingle 3)) - (mrgIf "b" (mrgSingle 2) (mrgSingle 4)), + @?= mrgIf + "a" + (mrgIf "b" (mrgSingle 1) (mrgSingle 3)) + (mrgIf "b" (mrgSingle 2) (mrgSingle 4)), testCase "minus" $ (mrgIf "a" (mrgSingle 0) (mrgSingle 1) :: UnionM Integer) - mrgIf "b" (mrgSingle $ -3) (mrgSingle $ -1) - @?= mrgIf - "a" - (mrgIf (symNot "b") (mrgSingle 1) (mrgSingle 3)) - (mrgIf (symNot "b") (mrgSingle 2) (mrgSingle 4)), + @?= mrgIf + "a" + (mrgIf (symNot "b") (mrgSingle 1) (mrgSingle 3)) + (mrgIf (symNot "b") (mrgSingle 2) (mrgSingle 4)), testCase "times" $ (mrgIf "a" (mrgSingle 1) (mrgSingle 2) :: UnionM Integer) * mrgIf "b" (mrgSingle 3) (mrgSingle 4) - @?= mrgIf - "a" - (mrgIf "b" (mrgSingle 3) (mrgSingle 4)) - (mrgIf "b" (mrgSingle 6) (mrgSingle 8)), + @?= mrgIf + "a" + (mrgIf "b" (mrgSingle 3) (mrgSingle 4)) + (mrgIf "b" (mrgSingle 6) (mrgSingle 8)), testCase "abs" $ abs (mrgIf "a" (mrgSingle $ -1) (mrgSingle 2) :: UnionM Integer) @?= mrgIf "a" (mrgSingle 1) (mrgSingle 2), diff --git a/test/Grisette/Core/Data/Class/EvaluateSymTests.hs b/test/Grisette/Core/Data/Class/EvaluateSymTests.hs index 6b94cc26..2e04ca14 100644 --- a/test/Grisette/Core/Data/Class/EvaluateSymTests.hs +++ b/test/Grisette/Core/Data/Class/EvaluateSymTests.hs @@ -64,15 +64,15 @@ evaluateSymTests = testCase ".||" $ eval (ssym "a" .|| ssym "b") @?= ssym "a" - .|| ssym "b", + .|| ssym "b", testCase ".&&" $ eval (ssym "a" .&& ssym "b") @?= ssym "a" - .&& ssym "b", + .&& ssym "b", testCase ".==" $ eval ((ssym "a" :: SymBool) .== ssym "b") @?= (ssym "a" :: SymBool) - .== ssym "b", + .== ssym "b", testCase "symNot" $ eval (symNot (ssym "a")) @?= symNot (ssym "a"), diff --git a/test/Grisette/Core/Data/Class/SEqTests.hs b/test/Grisette/Core/Data/Class/SEqTests.hs index b3156f23..f0323686 100644 --- a/test/Grisette/Core/Data/Class/SEqTests.hs +++ b/test/Grisette/Core/Data/Class/SEqTests.hs @@ -101,12 +101,12 @@ seqTests = [ssymBool "a"] .== [ssymBool "b"] @=? ssymBool "a" - .== ssymBool "b", + .== ssymBool "b", testCase "Same length 2" $ [ssymBool "a", ssymBool "b"] .== [ssymBool "c", ssymBool "d"] @=? (ssymBool "a" .== ssymBool "c") - .&& (ssymBool "b" .== ssymBool "d"), + .&& (ssymBool "b" .== ssymBool "d"), testCase "length 1 vs length 0" $ [ssymBool "a"] .== [] @=? conBool False, testCase "length 1 vs length 2" $ @@ -131,7 +131,7 @@ seqTests = Just (ssymBool "a") .== Just (ssymBool "b") @=? ssymBool "a" - .== ssymBool "b" + .== ssymBool "b" ] ], testGroup @@ -144,7 +144,7 @@ seqTests = (Left (ssymBool "a") :: Either SymBool SymBool) .== Left (ssymBool "b") @=? ssymBool "a" - .== ssymBool "b", + .== ssymBool "b", testCase "Right vs Left" $ (Right (ssymBool "a") :: Either SymBool SymBool) .== Left (ssymBool "b") @@ -157,7 +157,7 @@ seqTests = (Right (ssymBool "a") :: Either SymBool SymBool) .== Right (ssymBool "b") @=? ssymBool "a" - .== ssymBool "b" + .== ssymBool "b" ] ], testGroup @@ -208,7 +208,7 @@ seqTests = MaybeT Maybe SymBool ) @=? ssymBool "a" - .== ssymBool "b" + .== ssymBool "b" ] ], testGroup @@ -246,7 +246,7 @@ seqTests = ExceptT SymBool Maybe SymBool ) @=? ssymBool "a" - .== ssymBool "b", + .== ssymBool "b", testCase "ExceptT (Just (Right v)) vs ExceptT (Just (Left v))" $ ExceptT (Just (Right (ssymBool "a"))) @@ -268,7 +268,7 @@ seqTests = ExceptT SymBool Maybe SymBool ) @=? ssymBool "a" - .== ssymBool "b" + .== ssymBool "b" ] ], testProperty "()" (ioProperty . concreteSEqOkProp @()), @@ -280,9 +280,9 @@ seqTests = (ssymBool "a", ssymBool "c") .== (ssymBool "b", ssymBool "d") @=? ssymBool "a" - .== ssymBool "b" - .&& ssymBool "c" - .== ssymBool "d" + .== ssymBool "b" + .&& ssymBool "c" + .== ssymBool "d" ], testGroup "(,,)" @@ -292,9 +292,9 @@ seqTests = (ssymBool "a", ssymBool "c", ssymBool "e") .== (ssymBool "b", ssymBool "d", ssymBool "f") @=? (ssymBool "a" .== ssymBool "b") - .&& ( (ssymBool "c" .== ssymBool "d") - .&& (ssymBool "e" .== ssymBool "f") - ) + .&& ( (ssymBool "c" .== ssymBool "d") + .&& (ssymBool "e" .== ssymBool "f") + ) ], testGroup "(,,,)" @@ -308,9 +308,9 @@ seqTests = @=? ( (ssymBool "a" .== ssymBool "b") .&& (ssymBool "c" .== ssymBool "d") ) - .&& ( (ssymBool "e" .== ssymBool "f") - .&& (ssymBool "g" .== ssymBool "h") - ) + .&& ( (ssymBool "e" .== ssymBool "f") + .&& (ssymBool "g" .== ssymBool "h") + ) ], testGroup "(,,,,)" @@ -335,11 +335,11 @@ seqTests = @=? ( (ssymBool "a" .== ssymBool "b") .&& (ssymBool "c" .== ssymBool "d") ) - .&& ( (ssymBool "e" .== ssymBool "f") - .&& ( (ssymBool "g" .== ssymBool "h") - .&& (ssymBool "i" .== ssymBool "j") - ) - ) + .&& ( (ssymBool "e" .== ssymBool "f") + .&& ( (ssymBool "g" .== ssymBool "h") + .&& (ssymBool "i" .== ssymBool "j") + ) + ) ], testGroup "(,,,,,)" @@ -375,11 +375,11 @@ seqTests = .&& (ssymBool "e" .== ssymBool "f") ) ) - .&& ( (ssymBool "g" .== ssymBool "h") - .&& ( (ssymBool "i" .== ssymBool "j") - .&& (ssymBool "k" .== ssymBool "l") - ) - ) + .&& ( (ssymBool "g" .== ssymBool "h") + .&& ( (ssymBool "i" .== ssymBool "j") + .&& (ssymBool "k" .== ssymBool "l") + ) + ) ], testGroup "(,,,,,,)" @@ -419,13 +419,13 @@ seqTests = .&& (ssymBool "e" .== ssymBool "f") ) ) - .&& ( ( (ssymBool "g" .== ssymBool "h") - .&& (ssymBool "i" .== ssymBool "j") + .&& ( ( (ssymBool "g" .== ssymBool "h") + .&& (ssymBool "i" .== ssymBool "j") + ) + .&& ( (ssymBool "k" .== ssymBool "l") + .&& (ssymBool "m" .== ssymBool "n") + ) ) - .&& ( (ssymBool "k" .== ssymBool "l") - .&& (ssymBool "m" .== ssymBool "n") - ) - ) ], testGroup "(,,,,,,,)" @@ -469,13 +469,13 @@ seqTests = .&& (ssymBool "g" .== ssymBool "h") ) ) - .&& ( ( (ssymBool "i" .== ssymBool "j") - .&& (ssymBool "k" .== ssymBool "l") + .&& ( ( (ssymBool "i" .== ssymBool "j") + .&& (ssymBool "k" .== ssymBool "l") + ) + .&& ( (ssymBool "m" .== ssymBool "n") + .&& (ssymBool "o" .== ssymBool "p") + ) ) - .&& ( (ssymBool "m" .== ssymBool "n") - .&& (ssymBool "o" .== ssymBool "p") - ) - ) ], testCase "ByteString" $ do let bytestrings :: [B.ByteString] = ["", "a", "ab"] @@ -500,7 +500,7 @@ seqTests = (InL $ Just $ ssymBool "a" :: Sum Maybe Maybe SymBool) .== InL (Just $ ssymBool "b") @=? ssymBool "a" - .== ssymBool "b", + .== ssymBool "b", testCase "InL (Just v) vs InR (Just v)" $ (InL $ Just $ ssymBool "a" :: Sum Maybe Maybe SymBool) .== InR (Just $ ssymBool "b") @@ -509,7 +509,7 @@ seqTests = (InR $ Just $ ssymBool "a" :: Sum Maybe Maybe SymBool) .== InR (Just $ ssymBool "b") @=? ssymBool "a" - .== ssymBool "b", + .== ssymBool "b", testCase "InR (Just v) vs InL (Just v)" $ (InR $ Just $ ssymBool "a" :: Sum Maybe Maybe SymBool) .== InL (Just $ ssymBool "b") @@ -539,7 +539,7 @@ seqTests = ) .== WriterLazy.WriterT (Left $ ssymBool "b") @=? ssymBool "a" - .== ssymBool "b", + .== ssymBool "b", testCase "WriterT (Left v) vs WriterT (Right v)" $ ( WriterLazy.WriterT (Left $ ssymBool "a") :: WriterLazy.WriterT SymBool (Either SymBool) SymBool @@ -562,7 +562,7 @@ seqTests = .== WriterLazy.WriterT (Right (ssymBool "c", ssymBool "d")) @=? (ssymBool "a" .== ssymBool "c") - .&& (ssymBool "b" .== ssymBool "d") + .&& (ssymBool "b" .== ssymBool "d") ] ], testGroup @@ -589,7 +589,7 @@ seqTests = ) .== WriterStrict.WriterT (Left $ ssymBool "b") @=? ssymBool "a" - .== ssymBool "b", + .== ssymBool "b", testCase "WriterT (Left v) vs WriterT (Right v)" $ ( WriterStrict.WriterT (Left $ ssymBool "a") :: WriterStrict.WriterT @@ -621,9 +621,9 @@ seqTests = .== WriterStrict.WriterT (Right (ssymBool "c", ssymBool "d")) @=? ssymBool "a" - .== ssymBool "c" - .&& ssymBool "b" - .== ssymBool "d" + .== ssymBool "c" + .&& ssymBool "b" + .== ssymBool "d" ] ] ], @@ -638,7 +638,7 @@ seqTests = (Identity $ ssymBool "a" :: Identity SymBool) .== Identity (ssymBool "b") @=? ssymBool "a" - .== ssymBool "b" + .== ssymBool "b" ], testGroup "IdentityT" @@ -655,7 +655,7 @@ seqTests = ) .== IdentityT (Left $ ssymBool "b") @=? ssymBool "a" - .== ssymBool "b", + .== ssymBool "b", testCase "IdentityT (Left v) vs IdentityT (Right v)" $ ( IdentityT $ Left $ ssymBool "a" :: IdentityT (Either SymBool) SymBool @@ -674,7 +674,7 @@ seqTests = ) .== IdentityT (Right $ ssymBool "b") @=? ssymBool "a" - .== ssymBool "b" + .== ssymBool "b" ] ] ], @@ -694,7 +694,7 @@ seqTests = A2 (ssymBool "a") .== A2 (ssymBool "b") @=? ssymBool "a" - .== ssymBool "b", + .== ssymBool "b", testCase "A2 vs A3" $ A2 (ssymBool "a") .== A3 (ssymBool "b") (ssymBool "c") @@ -709,7 +709,7 @@ seqTests = A3 (ssymBool "a") (ssymBool "b") .== A3 (ssymBool "c") (ssymBool "d") @=? (ssymBool "a" .== ssymBool "c") - .&& (ssymBool "b" .== ssymBool "d") + .&& (ssymBool "b" .== ssymBool "d") ] ] ] diff --git a/test/Grisette/Core/Data/Class/SOrdTests.hs b/test/Grisette/Core/Data/Class/SOrdTests.hs index 3bf53999..e2308b65 100644 --- a/test/Grisette/Core/Data/Class/SOrdTests.hs +++ b/test/Grisette/Core/Data/Class/SOrdTests.hs @@ -102,19 +102,19 @@ sordTests = ssymBool "a" .<= ssymBool "b" @?= (symNot (ssymBool "a")) - .|| (ssymBool "b") + .|| (ssymBool "b") ssymBool "a" .< ssymBool "b" @?= (symNot (ssymBool "a")) - .&& (ssymBool "b") + .&& (ssymBool "b") ssymBool "a" .>= ssymBool "b" @?= (ssymBool "a") - .|| (symNot (ssymBool "b")) + .|| (symNot (ssymBool "b")) ssymBool "a" .> ssymBool "b" @?= (ssymBool "a") - .&& (symNot (ssymBool "b")) + .&& (symNot (ssymBool "b")) symCompare (ssymBool "a") (ssymBool "b") @?= ( mrgIf ((symNot (ssymBool "a")) .&& (ssymBool "b"))