* fix nim js cmp fails at CT * close #9622 add testcase
This commit is contained in:
parent
207bcabdf2
commit
a5600e49df
1 changed files with 30 additions and 0 deletions
30
tests/vm/t9622.nim
Normal file
30
tests/vm/t9622.nim
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
discard """
|
||||||
|
targets: "c cpp"
|
||||||
|
matrix: "--gc:refc; --gc:arc"
|
||||||
|
"""
|
||||||
|
|
||||||
|
type
|
||||||
|
GlobNodeKind = enum
|
||||||
|
LiteralIdent,
|
||||||
|
Group
|
||||||
|
|
||||||
|
GlobNode = object
|
||||||
|
case kind: GlobNodeKind
|
||||||
|
of LiteralIdent:
|
||||||
|
value: string
|
||||||
|
of Group:
|
||||||
|
values: seq[string]
|
||||||
|
|
||||||
|
PathSegment = object
|
||||||
|
children: seq[GlobNode]
|
||||||
|
|
||||||
|
GlobPattern = seq[PathSegment]
|
||||||
|
|
||||||
|
proc parseImpl(): GlobPattern =
|
||||||
|
if result.len == 0:
|
||||||
|
result.add PathSegment()
|
||||||
|
result[^1].children.add GlobNode(kind: LiteralIdent)
|
||||||
|
|
||||||
|
block:
|
||||||
|
const pattern = parseImpl()
|
||||||
|
doAssert $pattern == """@[(children: @[(kind: LiteralIdent, value: "")])]"""
|
||||||
Loading…
Add table
Add a link
Reference in a new issue