summary refs log tree commit diff stats
path: root/tests/stdlib/tpegs.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/stdlib/tpegs.nim')
-rw-r--r--tests/stdlib/tpegs.nim18
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/stdlib/tpegs.nim b/tests/stdlib/tpegs.nim
index cbc8fe205..da3fc14b7 100644
--- a/tests/stdlib/tpegs.nim
+++ b/tests/stdlib/tpegs.nim
@@ -1,4 +1,5 @@
 discard """
+  matrix: "--mm:refc; --mm:orc"
   targets: "c cpp js"
   output: '''
 PEG AST traversal output
@@ -106,9 +107,9 @@ block:
 
 block:
   var
-    pStack: seq[string] = @[]
-    valStack: seq[float] = @[]
-    opStack = ""
+    pStack {.threadvar.}: seq[string]
+    valStack {.threadvar.}: seq[float]
+    opStack {.threadvar.}: string
   let
     parseArithExpr = pegAst.eventParser:
       pkNonTerminal:
@@ -328,7 +329,16 @@ call()
       doAssert program.len == program.rawMatch(grammar, 0, c)
       doAssert c.ml == 1
 
+    block:
+      # bug #21632
+
+      let p = peg"""
+        atext <- \w / \d
+      """
+
+      doAssert "a".match(p)
+      doAssert "1".match(p)
+
   pegsTest()
   static:
     pegsTest()
-