Skip to content

Commit b182c6b

Browse files
authored
Merge pull request #5541 from sellout/improve-test-expectations
Various improvements to EasyTest expectations
2 parents d3dea93 + afb5d4a commit b182c6b

File tree

7 files changed

+168
-149
lines changed

7 files changed

+168
-149
lines changed

parser-typechecker/tests/Unison/Core/Test/Name.hs

Lines changed: 54 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -25,64 +25,63 @@ test =
2525

2626
testCompareSuffix :: [Test ()]
2727
testCompareSuffix =
28-
[ scope "[b.c a.b.c]" (expectEqual (compareSuffix (Name.unsafeParseText "b.c") (Name.unsafeParseText "a.b.c")) EQ),
29-
scope "[a.b.c a.b.c]" (expectEqual (compareSuffix (Name.unsafeParseText "a.b.c") (Name.unsafeParseText "a.b.c")) EQ),
30-
scope "[b.c a.b.b]" (expectEqual (compareSuffix (Name.unsafeParseText "b.c") (Name.unsafeParseText "a.b.b")) LT),
31-
scope "[a.b.c b.c]" (expectEqual (compareSuffix (Name.unsafeParseText "a.b.c") (Name.unsafeParseText "b.c")) LT),
32-
scope "[b.b a.b.c]" (expectEqual (compareSuffix (Name.unsafeParseText "b.b") (Name.unsafeParseText "a.b.c")) GT)
28+
[ scope "[b.c a.b.c]" . expectEqual EQ $ compareSuffix (Name.unsafeParseText "b.c") (Name.unsafeParseText "a.b.c"),
29+
scope "[a.b.c a.b.c]" . expectEqual EQ $ compareSuffix (Name.unsafeParseText "a.b.c") (Name.unsafeParseText "a.b.c"),
30+
scope "[b.c a.b.b]" . expectEqual LT $ compareSuffix (Name.unsafeParseText "b.c") (Name.unsafeParseText "a.b.b"),
31+
scope "[a.b.c b.c]" . expectEqual LT $ compareSuffix (Name.unsafeParseText "a.b.c") (Name.unsafeParseText "b.c"),
32+
scope "[b.b a.b.c]" . expectEqual GT $ compareSuffix (Name.unsafeParseText "b.b") (Name.unsafeParseText "a.b.c")
3333
]
3434

3535
testEndsWithReverseSegments :: [Test ()]
3636
testEndsWithReverseSegments =
37-
[ scope "a.b.c ends with []" (expectEqual True (endsWithReverseSegments (Name.unsafeParseText "a.b.c") [])),
38-
scope
39-
"a.b.c ends with [c, b]"
40-
(expectEqual True (endsWithReverseSegments (Name.unsafeParseText "a.b.c") [NameSegment "c", NameSegment "b"])),
41-
scope
42-
"a.b.c doesn't end with [d]"
43-
(expectEqual False (endsWithReverseSegments (Name.unsafeParseText "a.b.c") [NameSegment "d"]))
37+
[ scope "a.b.c ends with []" . expectEqual True $ endsWithReverseSegments (Name.unsafeParseText "a.b.c") [],
38+
scope "a.b.c ends with [c, b]" . expectEqual True $
39+
endsWithReverseSegments (Name.unsafeParseText "a.b.c") [NameSegment "c", NameSegment "b"],
40+
scope "a.b.c doesn't end with [d]" . expectEqual False $
41+
endsWithReverseSegments (Name.unsafeParseText "a.b.c") [NameSegment "d"]
4442
]
4543

4644
testEndsWithSegments :: [Test ()]
4745
testEndsWithSegments =
48-
[ scope "a.b.c ends with []" (expectEqual True (endsWithSegments (Name.unsafeParseText "a.b.c") [])),
49-
scope
50-
"a.b.c ends with [b, c]"
51-
(expectEqual True (endsWithSegments (Name.unsafeParseText "a.b.c") [NameSegment "b", NameSegment "c"])),
52-
scope
53-
"a.b.c doesn't end with [d]"
54-
(expectEqual False (endsWithSegments (Name.unsafeParseText "a.b.c") [NameSegment "d"]))
46+
[ scope "a.b.c ends with []" . expectEqual True $ endsWithSegments (Name.unsafeParseText "a.b.c") [],
47+
scope "a.b.c ends with [b, c]" . expectEqual True $
48+
endsWithSegments (Name.unsafeParseText "a.b.c") [NameSegment "b", NameSegment "c"],
49+
scope "a.b.c doesn't end with [d]" . expectEqual False $
50+
endsWithSegments (Name.unsafeParseText "a.b.c") [NameSegment "d"]
5551
]
5652

5753
testSegments :: [Test ()]
5854
testSegments =
5955
[ do
6056
n <- int' 1 10
6157
segs <- List.NonEmpty.fromList <$> listOf n (pick [NameSegment ".", NameSegment "foo"])
62-
expectEqual (segments (fromSegments segs)) segs
58+
expectEqual segs $ segments (fromSegments segs)
6359
]
6460

6561
testSplitName :: [Test ()]
6662
testSplitName =
67-
[ scope "x" (expectEqual (splits (Name.unsafeParseText "x")) [([], Name.unsafeParseText "x")]),
68-
scope "A.x" (expectEqual (splits (Name.unsafeParseText "A.x")) [([], Name.unsafeParseText "A.x"), ([NameSegment "A"], Name.unsafeParseText "x")]),
69-
scope
70-
"A.B.x"
71-
( expectEqual
72-
(splits (Name.unsafeParseText "A.B.x"))
73-
[ ([], Name.unsafeParseText "A.B.x"),
74-
([NameSegment "A"], Name.unsafeParseText "B.x"),
75-
([NameSegment "A", NameSegment "B"], Name.unsafeParseText "x")
76-
]
77-
)
63+
[ scope "x" . expectEqual [([], Name.unsafeParseText "x")] $ splits (Name.unsafeParseText "x"),
64+
scope "A.x" . expectEqual [([], Name.unsafeParseText "A.x"), ([NameSegment "A"], Name.unsafeParseText "x")] $
65+
splits (Name.unsafeParseText "A.x"),
66+
scope "A.B.x"
67+
. expectEqual
68+
[ ([], Name.unsafeParseText "A.B.x"),
69+
([NameSegment "A"], Name.unsafeParseText "B.x"),
70+
([NameSegment "A", NameSegment "B"], Name.unsafeParseText "x")
71+
]
72+
$ splits (Name.unsafeParseText "A.B.x")
7873
]
7974

8075
testSuffixes :: [Test ()]
8176
testSuffixes =
82-
[ scope "one namespace" $ expectEqual (suffixes (Name.unsafeParseText "bar")) [Name.unsafeParseText "bar"],
83-
scope "two namespaces" $ expectEqual (suffixes (Name.unsafeParseText "foo.bar")) [Name.unsafeParseText "bar", Name.unsafeParseText "foo.bar"],
84-
scope "multiple namespaces" $ expectEqual (suffixes (Name.unsafeParseText "foo.bar.baz")) [Name.unsafeParseText "baz", Name.unsafeParseText "bar.baz", Name.unsafeParseText "foo.bar.baz"],
85-
scope "terms named `.`" $ expectEqual (suffixes (Name.unsafeParseText "base.`.`")) [Name.unsafeParseText "`.`", Name.unsafeParseText "base.`.`"]
77+
[ scope "one namespace" . expectEqual [Name.unsafeParseText "bar"] $ suffixes (Name.unsafeParseText "bar"),
78+
scope "two namespaces" . expectEqual [Name.unsafeParseText "bar", Name.unsafeParseText "foo.bar"] $
79+
suffixes (Name.unsafeParseText "foo.bar"),
80+
scope "multiple namespaces"
81+
. expectEqual [Name.unsafeParseText "baz", Name.unsafeParseText "bar.baz", Name.unsafeParseText "foo.bar.baz"]
82+
$ suffixes (Name.unsafeParseText "foo.bar.baz"),
83+
scope "terms named `.`" . expectEqual [Name.unsafeParseText "`.`", Name.unsafeParseText "base.`.`"] $
84+
suffixes (Name.unsafeParseText "base.`.`")
8685
]
8786

8887
testSuffixSearch :: [Test ()]
@@ -99,44 +98,44 @@ testSuffixSearch =
9998
(n ".`.`", 6)
10099
]
101100
n = Name.unsafeParseText
102-
expectEqual' (NameSegment "." :| []) (Name.reverseSegments (n ".`.`"))
103-
expectEqual' (NameSegment "." :| []) (Name.reverseSegments (n ".`.`"))
101+
expectEqual' (NameSegment "." :| []) $ Name.reverseSegments (n ".`.`")
102+
expectEqual' (NameSegment "." :| []) $ Name.reverseSegments (n ".`.`")
104103

105-
expectEqual' (Set.fromList [1, 2]) (Name.searchBySuffix (n "map") rel)
106-
expectEqual' (n "List.map") (Name.suffixifyByHash (n "base.List.map") rel)
107-
expectEqual' (n "Set.map") (Name.suffixifyByHash (n "base.Set.map") rel)
108-
expectEqual' (n "baz") (Name.suffixifyByHash (n "foo.bar.baz") rel)
109-
expectEqual' (n "a.b.c") (Name.suffixifyByHash (n "a.b.c") rel)
110-
expectEqual' (n "a1.b.c") (Name.suffixifyByHash (n "a1.b.c") rel)
104+
expectEqual' (Set.fromList [1, 2]) $ Name.searchBySuffix (n "map") rel
105+
expectEqual' (n "List.map") $ Name.suffixifyByHash (n "base.List.map") rel
106+
expectEqual' (n "Set.map") $ Name.suffixifyByHash (n "base.Set.map") rel
107+
expectEqual' (n "baz") $ Name.suffixifyByHash (n "foo.bar.baz") rel
108+
expectEqual' (n "a.b.c") $ Name.suffixifyByHash (n "a.b.c") rel
109+
expectEqual' (n "a1.b.c") $ Name.suffixifyByHash (n "a1.b.c") rel
111110
note . show $ Name.reverseSegments (n "`.`")
112111
note . show $ Name.reverseSegments (n ".`.`")
113112
tests
114-
[ scope "(.) shortest unique suffix" $ expectEqual' (n "`.`") (Name.suffixifyByHash (n ".`.`") rel),
115-
scope "(.) search by suffix" $ expectEqual' (Set.fromList [6]) (Name.searchBySuffix (n "`.`") rel)
113+
[ scope "(.) shortest unique suffix" . expectEqual' (n "`.`") $ Name.suffixifyByHash (n ".`.`") rel,
114+
scope "(.) search by suffix" . expectEqual' (Set.fromList [6]) $ Name.searchBySuffix (n "`.`") rel
116115
]
117116
ok
118117
]
119118

120119
testUnsafeFromString :: [Test ()]
121120
testUnsafeFromString =
122121
[ scope "." do
123-
expectEqual' (isAbsolute (Name.unsafeParseText "`.`")) False
124-
expectEqual' (segments (Name.unsafeParseText "`.`")) (NameSegment "." :| [])
122+
expectEqual' False $ isAbsolute (Name.unsafeParseText "`.`")
123+
expectEqual' (NameSegment "." :| []) $ segments (Name.unsafeParseText "`.`")
125124
ok,
126125
scope ".`.`" do
127-
expectEqual' (isAbsolute (Name.unsafeParseText ".`.`")) True
128-
expectEqual' (segments (Name.unsafeParseText ".`.`")) (NameSegment "." :| [])
126+
expectEqual' True $ isAbsolute (Name.unsafeParseText ".`.`")
127+
expectEqual' (NameSegment "." :| []) $ segments (Name.unsafeParseText ".`.`")
129128
ok,
130129
scope "foo.bar" do
131-
expectEqual' (isAbsolute (Name.unsafeParseText "foo.bar")) False
132-
expectEqual' (segments (Name.unsafeParseText "foo.bar")) (NameSegment "foo" :| [NameSegment "bar"])
130+
expectEqual' False $ isAbsolute (Name.unsafeParseText "foo.bar")
131+
expectEqual' (NameSegment "foo" :| [NameSegment "bar"]) $ segments (Name.unsafeParseText "foo.bar")
133132
ok,
134133
scope ".foo.bar" do
135-
expectEqual' (isAbsolute (Name.unsafeParseText ".foo.bar")) True
136-
expectEqual' (segments (Name.unsafeParseText ".foo.bar")) (NameSegment "foo" :| [NameSegment "bar"])
134+
expectEqual' True $ isAbsolute (Name.unsafeParseText ".foo.bar")
135+
expectEqual' (NameSegment "foo" :| [NameSegment "bar"]) $ segments (Name.unsafeParseText ".foo.bar")
137136
ok,
138137
scope "foo.`.`" do
139-
expectEqual' (isAbsolute (Name.unsafeParseText "foo.`.`")) False
140-
expectEqual' (segments (Name.unsafeParseText "foo.`.`")) (NameSegment "foo" :| [NameSegment "."])
138+
expectEqual' False $ isAbsolute (Name.unsafeParseText "foo.`.`")
139+
expectEqual' (NameSegment "foo" :| [NameSegment "."]) $ segments (Name.unsafeParseText "foo.`.`")
141140
ok
142141
]

parser-typechecker/tests/Unison/Test/Util/Text.hs

Lines changed: 76 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ module Unison.Test.Util.Text where
44

55
import Control.Monad
66
import Data.List (foldl', unfoldr)
7-
import Data.Maybe (isNothing)
87
import Data.Text qualified as T
98
import EasyTest
109
import Unison.Util.Rope qualified as R
@@ -14,20 +13,20 @@ import Unison.Util.Text.Pattern qualified as P
1413
test :: Test ()
1514
test =
1615
scope "util.text" . tests $
17-
[ scope "empty ==" . expect $ Text.empty == Text.empty,
18-
scope "empty `compare`" . expect $ Text.empty `compare` Text.empty == EQ,
16+
[ scope "empty ==" $ expectEqual Text.empty Text.empty,
17+
scope "empty `compare`" . expectEqual EQ $ Text.empty `compare` Text.empty,
1918
scope "==" . expect $
2019
let a = join (replicate 100 ['a' .. 'z'])
2120
b = join (replicate 45 ['A' .. 'Z'])
2221
in (Text.pack a <> Text.pack b) == Text.pack (a ++ b),
2322
scope "at" $ do
24-
expect' (Text.at 0 (Text.pack "abc") == Just 'a')
25-
expect' (Text.at 0 mempty == Nothing)
23+
expectEqual' (Just 'a') $ Text.at 0 (Text.pack "abc")
24+
expectEqual' Nothing $ Text.at 0 mempty
2625
ok,
2726
scope "at.cornerCases" $ do
2827
let b = Text.drop 3 $ "abc" <> "def"
29-
expect' (Text.at 0 b == Just 'd')
30-
expect' (Text.at 0 (mempty <> "abc") == Just 'a')
28+
expectEqual' (Just 'd') $ Text.at 0 b
29+
expectEqual' (Just 'a') $ Text.at 0 (mempty <> "abc")
3130
ok,
3231
scope "consistency with Text" $ do
3332
forM_ [(1 :: Int) .. 100] $ \_ -> do
@@ -62,7 +61,7 @@ test =
6261
let bs = t1s <> t2s <> t3s
6362
b = t1 <> t2 <> t3
6463
in forM_ [0 .. (T.length b - 1)] $ \ind ->
65-
expect' $ Just (T.index b ind) == Text.at ind bs
64+
expectEqual' (Just (T.index b ind)) $ Text.at ind bs
6665
ok,
6766
scope "lots of chunks" $ do
6867
forM_ [(0 :: Int) .. 25] $ \_ -> do
@@ -74,9 +73,9 @@ test =
7473
b3 = foldl' (<>) mempty (Text.pack <$> chunks)
7574
b = T.concat (T.pack <$> chunks)
7675
expect' $ b1 == b2 && b2 == b3
77-
expect' $ Text.toText b1 == b
78-
expect' $ Text.toText b2 == b
79-
expect' $ Text.toText b3 == b
76+
expectEqual' b $ Text.toText b1
77+
expectEqual' b $ Text.toText b2
78+
expectEqual' b $ Text.toText b3
8079
ok,
8180
scope "depth checks" $ do
8281
chunk <- Text.pack <$> replicateM 1000 char
@@ -102,38 +101,58 @@ test =
102101
expect' (maxDepth < log2 (i * n) * 2)
103102
ok,
104103
scope "patterns" $ do
105-
expect' (P.run P.Eof "" == Just ([], ""))
106-
expect' (P.run (P.Char P.Any) "a" == Just ([], ""))
107-
expect' (P.run (P.Char (P.CharRange 'a' 'z')) "a" == Just ([], ""))
108-
expect' . isNothing $ P.run (P.Char (P.Not (P.CharRange 'a' 'z'))) "a"
109-
expect' (P.run (P.Or (P.Char (P.Not (P.CharRange 'a' 'z'))) (P.Char P.Any)) "abc" == Just ([], "bc"))
104+
expectEqual' (Just ([], "")) $ P.run P.Eof ""
105+
expectEqual' (Just ([], "")) $ P.run (P.Char P.Any) "a"
106+
expectEqual' (Just ([], "")) $ P.run (P.Char (P.CharRange 'a' 'z')) "a"
107+
expectEqual' Nothing $ P.run (P.Char (P.Not (P.CharRange 'a' 'z'))) "a"
108+
expectEqual' (Just ([], "bc")) $ P.run (P.Or (P.Char (P.Not (P.CharRange 'a' 'z'))) (P.Char P.Any)) "abc"
110109
-- this shows that we ignore subcaptures
111-
expect' (P.run (P.Join [P.Capture (P.Join [P.Capture (P.Char P.Any), P.Capture (P.Char P.Any)]), P.Char P.Any]) "abcdef" == Just (["ab"], "def"))
112-
expect' (P.run (P.Char (P.CharSet "0123")) "3ab" == Just ([], "ab"))
113-
expect' (P.run (P.Char (P.Not (P.CharSet "0123"))) "a3b" == Just ([], "3b"))
114-
expect' (P.run (P.Capture (P.Char (P.Not (P.CharSet "0123")))) "a3b" == Just (["a"], "3b"))
115-
expect' (P.run (P.Many True (P.Char (P.CharSet "abcd"))) "babbababac123" == Just ([], "123"))
116-
expect' (P.run (P.Capture (P.Many True (P.Char (P.CharSet "abcd")))) "babbababac123" == Just (["babbababac"], "123"))
117-
expect' (P.run (P.Capture (P.Many True (P.Char (P.CharClass P.Number)))) "012345abc" == Just (["012345"], "abc"))
118-
expect' (P.run (P.Join [P.Capture (P.Many True (P.Char (P.CharClass P.Number))), P.Literal ",", P.Capture (P.Many True (P.Char P.Any))]) "012345,abc" == Just (["012345", "abc"], ""))
119-
expect'
120-
( P.run (P.Many True (P.Join [P.Capture (P.Many True (P.Char (P.CharClass P.Number))), P.Many True (P.Char (P.CharClass P.Whitespace))])) "01 10 20 1123 292 110 10"
121-
== Just (["01", "10", "20", "1123", "292", "110", "10"], "")
122-
)
123-
expect' $
110+
expectEqual' (Just (["ab"], "def")) $
111+
P.run
112+
(P.Join [P.Capture (P.Join [P.Capture (P.Char P.Any), P.Capture (P.Char P.Any)]), P.Char P.Any])
113+
"abcdef"
114+
expectEqual' (Just ([], "ab")) $ P.run (P.Char (P.CharSet "0123")) "3ab"
115+
expectEqual' (Just ([], "3b")) $ P.run (P.Char (P.Not (P.CharSet "0123"))) "a3b"
116+
expectEqual' (Just (["a"], "3b")) $ P.run (P.Capture (P.Char (P.Not (P.CharSet "0123")))) "a3b"
117+
expectEqual' (Just ([], "123")) $ P.run (P.Many True (P.Char (P.CharSet "abcd"))) "babbababac123"
118+
expectEqual' (Just (["babbababac"], "123")) $
119+
P.run (P.Capture (P.Many True (P.Char (P.CharSet "abcd")))) "babbababac123"
120+
expectEqual' (Just (["012345"], "abc")) $
121+
P.run (P.Capture (P.Many True (P.Char (P.CharClass P.Number)))) "012345abc"
122+
expectEqual' (Just (["012345", "abc"], "")) $
123+
P.run
124+
( P.Join
125+
[ P.Capture (P.Many True (P.Char (P.CharClass P.Number))),
126+
P.Literal ",",
127+
P.Capture (P.Many True (P.Char P.Any))
128+
]
129+
)
130+
"012345,abc"
131+
expectEqual' (Just (["01", "10", "20", "1123", "292", "110", "10"], "")) $
132+
P.run
133+
( P.Many
134+
True
135+
( P.Join
136+
[ P.Capture (P.Many True (P.Char (P.CharClass P.Number))),
137+
P.Many True (P.Char (P.CharClass P.Whitespace))
138+
]
139+
)
140+
)
141+
"01 10 20 1123 292 110 10"
142+
expectEqual' (Just (["127", "0", "0", "1"], "")) $
124143
let part = P.Capture (P.Replicate 1 3 (P.Char (P.CharClass P.Number)))
125144
dpart = P.Join [P.Literal ".", part]
126145
ip = P.Join [part, P.Replicate 3 3 dpart, P.Eof]
127-
in P.run ip "127.0.0.1" == Just (["127", "0", "0", "1"], "")
128-
expect' $
146+
in P.run ip "127.0.0.1"
147+
expectEqual' (Just (["1", "2", "3", "4", "5"], "")) $
129148
let p = P.Replicate 5 8 (P.Capture (P.Char (P.CharClass P.Number)))
130-
in P.run p "12345" == Just (["1", "2", "3", "4", "5"], "")
131-
expect' $
149+
in P.run p "12345"
150+
expectEqual' (Just ([], "1234")) $
132151
let p = P.Replicate 5 8 (P.Capture (P.Char (P.CharClass P.Number))) `P.Or` P.Join []
133-
in P.run p "1234" == Just ([], "1234")
134-
expect' $
152+
in P.run p "1234"
153+
expectEqual' (Just (["1z", "2z", "3z", "4z", "5z"], "6a")) $
135154
let p = P.Replicate 5 8 (P.Capture (P.Join [P.Char (P.CharClass P.Number), P.Literal "z"])) `P.Or` P.Join []
136-
in P.run p "1z2z3z4z5z6a" == Just (["1z", "2z", "3z", "4z", "5z"], "6a")
155+
in P.run p "1z2z3z4z5z6a"
137156
-- https://github.com/unisonweb/unison/issues/3530
138157
expectEqual Nothing $
139158
let p =
@@ -178,26 +197,27 @@ test =
178197
in P.run p "zzzaaa!!!"
179198
ok,
180199
scope "ordinal" do
181-
expectEqual (Text.ordinal 1) ("1st" :: String)
182-
expectEqual (Text.ordinal 2) ("2nd" :: String)
183-
expectEqual (Text.ordinal 3) ("3rd" :: String)
184-
expectEqual (Text.ordinal 4) ("4th" :: String)
185-
expectEqual (Text.ordinal 5) ("5th" :: String)
186-
expectEqual (Text.ordinal 10) ("10th" :: String)
187-
expectEqual (Text.ordinal 11) ("11th" :: String)
188-
expectEqual (Text.ordinal 12) ("12th" :: String)
189-
expectEqual (Text.ordinal 13) ("13th" :: String)
190-
expectEqual (Text.ordinal 14) ("14th" :: String)
191-
expectEqual (Text.ordinal 21) ("21st" :: String)
192-
expectEqual (Text.ordinal 22) ("22nd" :: String)
193-
expectEqual (Text.ordinal 23) ("23rd" :: String)
194-
expectEqual (Text.ordinal 24) ("24th" :: String)
195-
expectEqual (Text.ordinal 111) ("111th" :: String)
196-
expectEqual (Text.ordinal 112) ("112th" :: String)
197-
expectEqual (Text.ordinal 113) ("113th" :: String)
198-
expectEqual (Text.ordinal 121) ("121st" :: String)
199-
expectEqual (Text.ordinal 122) ("122nd" :: String)
200-
expectEqual (Text.ordinal 123) ("123rd" :: String)
200+
let expectOrdinal = \ord -> expectEqual @String ord . Text.ordinal
201+
expectOrdinal "1st" 1
202+
expectOrdinal "2nd" 2
203+
expectOrdinal "3rd" 3
204+
expectOrdinal "4th" 4
205+
expectOrdinal "5th" 5
206+
expectOrdinal "10th" 10
207+
expectOrdinal "11th" 11
208+
expectOrdinal "12th" 12
209+
expectOrdinal "13th" 13
210+
expectOrdinal "14th" 14
211+
expectOrdinal "21st" 21
212+
expectOrdinal "22nd" 22
213+
expectOrdinal "23rd" 23
214+
expectOrdinal "24th" 24
215+
expectOrdinal "111th" 111
216+
expectOrdinal "112th" 112
217+
expectOrdinal "113th" 113
218+
expectOrdinal "121st" 121
219+
expectOrdinal "122nd" 122
220+
expectOrdinal "123rd" 123
201221
]
202222
where
203223
log2 :: Int -> Int

unison-cli/tests/Unison/Test/ClearCache.hs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ test = scope "clearWatchCache" $
3030
```
3131
|]
3232

33-
beforeClear <- listWatches
34-
expectNotEqual beforeClear []
33+
expectNotEqual [] =<< listWatches
3534

3635
io $
3736
Ucm.runTranscript
@@ -42,5 +41,4 @@ test = scope "clearWatchCache" $
4241
```
4342
|]
4443

45-
afterClear <- listWatches
46-
expectEqual afterClear []
44+
expectEqual [] =<< listWatches

0 commit comments

Comments
 (0)