* add testcase for bug #20305 * Update tcaseobj.nim Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
This commit is contained in:
parent
c9a92117f9
commit
7c85b500df
1 changed files with 25 additions and 0 deletions
|
|
@ -10,6 +10,7 @@ begin
|
||||||
end
|
end
|
||||||
prevented
|
prevented
|
||||||
(ok: true, value: "ok")
|
(ok: true, value: "ok")
|
||||||
|
@[(kind: P, pChildren: @[])]
|
||||||
myobj destroyed
|
myobj destroyed
|
||||||
'''
|
'''
|
||||||
"""
|
"""
|
||||||
|
|
@ -244,3 +245,27 @@ block:
|
||||||
|
|
||||||
doAssert j1.x1 == 2
|
doAssert j1.x1 == 2
|
||||||
doAssert j0.x0 == 2
|
doAssert j0.x0 == 2
|
||||||
|
|
||||||
|
# ------------------------------------
|
||||||
|
# bug #20305
|
||||||
|
|
||||||
|
type
|
||||||
|
ContentNodeKind = enum
|
||||||
|
P, Br, Text
|
||||||
|
ContentNode = object
|
||||||
|
case kind: ContentNodeKind
|
||||||
|
of P: pChildren: seq[ContentNode]
|
||||||
|
of Br: discard
|
||||||
|
of Text: textStr: string
|
||||||
|
|
||||||
|
proc bug20305 =
|
||||||
|
var x = ContentNode(kind: P, pChildren: @[
|
||||||
|
ContentNode(kind: P, pChildren: @[ContentNode(kind: Text, textStr: "brrr")])
|
||||||
|
])
|
||||||
|
x.pChildren.add ContentNode(kind: Br)
|
||||||
|
x.pChildren.del(0)
|
||||||
|
{.cast(uncheckedAssign).}:
|
||||||
|
x.pChildren[0].kind = P
|
||||||
|
echo x.pChildren
|
||||||
|
|
||||||
|
bug20305()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue