summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorMark Leyva <maleyva1@users.noreply.github.com>2023-03-20 10:50:58 -0700
committerGitHub <noreply@github.com>2023-03-20 18:50:58 +0100
commit285ea3c48e7b01fe6beecf794e9e8cc904c27889 (patch)
tree73a98b564351062b47393ec45f70e568819b7b9b /tests
parentfb00b482eb1ed685c93034360467ee76238e6548 (diff)
downloadNim-285ea3c48e7b01fe6beecf794e9e8cc904c27889.tar.gz
Fix: #21541. Add support for xnVerbatimText (#21542)
to text and text= procs. Remove unnecessary LF for xnVerbatimText
in $ proc.
Diffstat (limited to 'tests')
-rw-r--r--tests/stdlib/txmltree.nim15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/stdlib/txmltree.nim b/tests/stdlib/txmltree.nim
index 4362f5ec3..c87871544 100644
--- a/tests/stdlib/txmltree.nim
+++ b/tests/stdlib/txmltree.nim
@@ -99,3 +99,18 @@ block: # bug #21290
   doAssert s == """<foo>
   <bar>Hola<qux>    <plugh />  </qux></bar>
 </foo>"""
+
+block: #21541
+  let root = <>root()
+  root.add <>child(newText("hello"))
+  root.add <>more(newVerbatimText("hola"))
+  let s = $root
+  doAssert s == """<root>
+  <child>hello</child>
+  <more>hola</more>
+</root>"""
+
+  let temp = newVerbatimText("Hello!")
+  doAssert temp.text == "Hello!"
+  temp.text = "Hola!"
+  doAssert temp.text == "Hola!"