Skip to content

Commit

Permalink
🎨 automated ormolu commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lsrcz committed Jan 6, 2024
1 parent 605f16d commit 07abec7
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 80 deletions.
10 changes: 5 additions & 5 deletions src/Grisette/Core/Data/Union.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
32 changes: 16 additions & 16 deletions test/Grisette/Core/Control/Monad/UnionMTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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),
Expand Down
6 changes: 3 additions & 3 deletions test/Grisette/Core/Data/Class/EvaluateSymTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
104 changes: 52 additions & 52 deletions test/Grisette/Core/Data/Class/SEqTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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" $
Expand All @@ -131,7 +131,7 @@ seqTests =
Just (ssymBool "a")
.== Just (ssymBool "b")
@=? ssymBool "a"
.== ssymBool "b"
.== ssymBool "b"
]
],
testGroup
Expand All @@ -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")
Expand All @@ -157,7 +157,7 @@ seqTests =
(Right (ssymBool "a") :: Either SymBool SymBool)
.== Right (ssymBool "b")
@=? ssymBool "a"
.== ssymBool "b"
.== ssymBool "b"
]
],
testGroup
Expand Down Expand Up @@ -208,7 +208,7 @@ seqTests =
MaybeT Maybe SymBool
)
@=? ssymBool "a"
.== ssymBool "b"
.== ssymBool "b"
]
],
testGroup
Expand Down Expand Up @@ -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")))
Expand All @@ -268,7 +268,7 @@ seqTests =
ExceptT SymBool Maybe SymBool
)
@=? ssymBool "a"
.== ssymBool "b"
.== ssymBool "b"
]
],
testProperty "()" (ioProperty . concreteSEqOkProp @()),
Expand All @@ -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
"(,,)"
Expand All @@ -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
"(,,,)"
Expand All @@ -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
"(,,,,)"
Expand All @@ -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
"(,,,,,)"
Expand Down Expand Up @@ -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
"(,,,,,,)"
Expand Down Expand Up @@ -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
"(,,,,,,,)"
Expand Down Expand Up @@ -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"]
Expand All @@ -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")
Expand All @@ -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")
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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"
]
]
],
Expand All @@ -638,7 +638,7 @@ seqTests =
(Identity $ ssymBool "a" :: Identity SymBool)
.== Identity (ssymBool "b")
@=? ssymBool "a"
.== ssymBool "b"
.== ssymBool "b"
],
testGroup
"IdentityT"
Expand All @@ -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
Expand All @@ -674,7 +674,7 @@ seqTests =
)
.== IdentityT (Right $ ssymBool "b")
@=? ssymBool "a"
.== ssymBool "b"
.== ssymBool "b"
]
]
],
Expand All @@ -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")
Expand All @@ -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")
]
]
]
Loading

0 comments on commit 07abec7

Please sign in to comment.