summary refs log tree commit diff stats
path: root/test/captures.nim
diff options
context:
space:
mode:
authorFlaviu Tamas <tamasflaviu@gmail.com>2015-01-10 11:27:46 -0500
committerFlaviu Tamas <tamasflaviu@gmail.com>2015-01-10 11:27:46 -0500
commit00b047a6600b53a6439e9bf78d05894c5dd10297 (patch)
treea640378917a4c124897ceadb4d6f17f3b45ece08 /test/captures.nim
parentbfba4b99833b0f92ba58e549117cfa7c66367eac (diff)
downloadNim-00b047a6600b53a6439e9bf78d05894c5dd10297.tar.gz
Implement foundation for named captures
Diffstat (limited to 'test/captures.nim')
-rw-r--r--test/captures.nim7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/captures.nim b/test/captures.nim
new file mode 100644
index 000000000..769e9e4f0
--- /dev/null
+++ b/test/captures.nim
@@ -0,0 +1,7 @@
+import unittest
+include nre
+
+suite "captures":
+  test "map capture names to numbers":
+    check(getNameToNumberTable(initRegex("(?<v1>1(?<v2>2(?<v3>3))(?'v4'4))()")) == 
+      { "v1" : 1, "v2" : 2, "v3" : 3, "v4" : 4 }.toTable())