@@ -137,29 +137,26 @@ testStringCodePoints = do
137137 assert $ (singleton <$> codePointFromInt 0x16805 ) == Just " \x16805 "
138138
139139 log " splitAt"
140- let testSplitAt i s res =
140+ let testSplitAt i s r =
141141 assert $ case splitAt i s of
142- Nothing ->
143- isNothing res
144- Just { before, after } ->
145- maybe false (\r ->
146- r.before == before && r.after == after) res
147-
148- testSplitAt 0 " " $ Just {before: " " , after: " " }
149- testSplitAt 1 " " Nothing
150- testSplitAt 0 " a" $ Just {before: " " , after: " a" }
151- testSplitAt 1 " ab" $ Just {before: " a" , after: " b" }
152- testSplitAt 3 " aabcc" $ Just {before: " aab" , after: " cc" }
153- testSplitAt (-1 ) " abc" $ Nothing
154- testSplitAt 0 str $ Just {before: " " , after: str}
155- testSplitAt 1 str $ Just {before: " a" , after: " \xDC00\xD800\xD800\x16805\x16A06 \& z" }
156- testSplitAt 2 str $ Just {before: " a\xDC00 " , after: " \xD800\xD800\x16805\x16A06 \& z" }
157- testSplitAt 3 str $ Just {before: " a\xDC00\xD800 " , after: " \xD800\x16805\x16A06 \& z" }
158- testSplitAt 4 str $ Just {before: " a\xDC00\xD800\xD800 " , after: " \x16805\x16A06 \& z" }
159- testSplitAt 5 str $ Just {before: " a\xDC00\xD800\xD800\x16805 " , after: " \x16A06 \& z" }
160- testSplitAt 6 str $ Just {before: " a\xDC00\xD800\xD800\x16805\x16A06 " , after: " z" }
161- testSplitAt 7 str $ Just {before: str, after: " " }
162- testSplitAt 8 str $ Nothing
142+ { before, after } ->
143+ r.before == before && r.after == after
144+
145+ testSplitAt 0 " " {before: " " , after: " " }
146+ testSplitAt 1 " " {before: " " , after: " " }
147+ testSplitAt 0 " a" {before: " " , after: " a" }
148+ testSplitAt 1 " ab" {before: " a" , after: " b" }
149+ testSplitAt 3 " aabcc" {before: " aab" , after: " cc" }
150+ testSplitAt (-1 ) " abc" {before: " " , after: " abc" }
151+ testSplitAt 0 str {before: " " , after: str}
152+ testSplitAt 1 str {before: " a" , after: " \xDC00\xD800\xD800\x16805\x16A06 \& z" }
153+ testSplitAt 2 str {before: " a\xDC00 " , after: " \xD800\xD800\x16805\x16A06 \& z" }
154+ testSplitAt 3 str {before: " a\xDC00\xD800 " , after: " \xD800\x16805\x16A06 \& z" }
155+ testSplitAt 4 str {before: " a\xDC00\xD800\xD800 " , after: " \x16805\x16A06 \& z" }
156+ testSplitAt 5 str {before: " a\xDC00\xD800\xD800\x16805 " , after: " \x16A06 \& z" }
157+ testSplitAt 6 str {before: " a\xDC00\xD800\xD800\x16805\x16A06 " , after: " z" }
158+ testSplitAt 7 str {before: str, after: " " }
159+ testSplitAt 8 str {before: str, after: " " }
163160
164161 log " take"
165162 assert $ take (-1 ) str == " "
0 commit comments