File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ module Data.String
23
23
, dropWhile
24
24
, stripPrefix
25
25
, stripSuffix
26
+ , count
26
27
, split
27
28
, toCharArray
28
29
, toLower
Original file line number Diff line number Diff line change @@ -142,6 +142,12 @@ testString = do
142
142
assert $ drop 3 " ab" == " "
143
143
assert $ drop (-1 ) " ab" == " ab"
144
144
145
+ log " count"
146
+ assert $ count (_ == ' a' ) " " == 0
147
+ assert $ count (_ == ' a' ) " ab" == 1
148
+ assert $ count (_ == ' a' ) " aaab" == 3
149
+ assert $ count (_ == ' a' ) " abaa" == 1
150
+
145
151
log " split"
146
152
assert $ split " " " " == []
147
153
assert $ split " " " a" == [" a" ]
@@ -167,4 +173,3 @@ testString = do
167
173
assert $ joinWith " " [] == " "
168
174
assert $ joinWith " " [" a" , " b" ] == " ab"
169
175
assert $ joinWith " --" [" a" , " b" , " c" ] == " a--b--c"
170
-
You can’t perform that action at this time.
0 commit comments