diff options
author | Flaviu Tamas <tamasflaviu@gmail.com> | 2015-01-10 11:27:46 -0500 |
---|---|---|
committer | Flaviu Tamas <tamasflaviu@gmail.com> | 2015-01-10 11:27:46 -0500 |
commit | 00b047a6600b53a6439e9bf78d05894c5dd10297 (patch) | |
tree | a640378917a4c124897ceadb4d6f17f3b45ece08 /test/captures.nim | |
parent | bfba4b99833b0f92ba58e549117cfa7c66367eac (diff) | |
download | Nim-00b047a6600b53a6439e9bf78d05894c5dd10297.tar.gz |
Implement foundation for named captures
Diffstat (limited to 'test/captures.nim')
-rw-r--r-- | test/captures.nim | 7 |
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()) |