Skip to content

Commit e0e9c67

Browse files
author
Nick Obedin
committed
+ failing test for 'satisfy'
1 parent fdae3b1 commit e0e9c67

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

examples/Test.purs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,13 @@ exprTest = buildExprParser [[Infix (string "/" >>= \_ -> return (/)) AssocRight]
4646
,[Infix (string "*" >>= \_ -> return (*)) AssocRight]
4747
,[Infix (string "-" >>= \_ -> return (-)) AssocRight]
4848
,[Infix (string "+" >>= \_ -> return (+)) AssocRight]] digit
49-
49+
50+
manySatisfyTest :: Parser String [String]
51+
manySatisfyTest = do
52+
r <- many1 $ satisfy (\s -> s /= "?")
53+
string "?"
54+
return r
55+
5056
main = do
5157
parseTest nested "(((a)))"
5258
parseTest (many (string "a")) "aaa"
@@ -60,3 +66,4 @@ main = do
6066
return as) "a,a,a,"
6167
parseTest opTest "a+b+c"
6268
parseTest exprTest "1*2+3/4-5"
69+
parseTest manySatisfyTest "ab?" -- Should return "[a, b]" but it's not

0 commit comments

Comments
 (0)