mirror of
https://github.com/janet-lang/janet
synced 2025-10-18 17:27:40 +00:00
Merge pull request #1028 from autumnull/master
Made peg 'not' and 'if-not' drop their captures on success
This commit is contained in:
20
test/suite0014.janet
Normal file
20
test/suite0014.janet
Normal file
@@ -0,0 +1,20 @@
|
||||
(import ./helper :prefix "" :exit true)
|
||||
(start-suite 14)
|
||||
|
||||
(assert (deep=
|
||||
(peg/match '(not (* (constant 7) "a")) "hello")
|
||||
@[]) "peg not")
|
||||
|
||||
(assert (deep=
|
||||
(peg/match '(if-not (* (constant 7) "a") "hello") "hello")
|
||||
@[]) "peg if-not")
|
||||
|
||||
(assert (deep=
|
||||
(peg/match '(if-not (drop (* (constant 7) "a")) "hello") "hello")
|
||||
@[]) "peg if-not drop")
|
||||
|
||||
(assert (deep=
|
||||
(peg/match '(if (not (* (constant 7) "a")) "hello") "hello")
|
||||
@[]) "peg if not")
|
||||
|
||||
(end-suite)
|
Reference in New Issue
Block a user