summary refs log blame commit diff stats
path: root/tests/stdlib/txmltree.nim
blob: a849859e3305c4ebc906f0f28087ecaaa26e2b5e (plain) (tree)
1
2
3
4
5
6
7
8
9

                      





                 
   
 
                       
 
                                                      
 
                                                    
 


                                         
 






                             
discard """
  file: "txmltree.nim"
  output: '''true
true
true
true
true
'''
"""

import xmltree, strtabs

var x = <>a(href="nim.de", newText("www.nim-test.de"))

echo($x == "<a href=\"nim.de\">www.nim-test.de</a>")

echo(newText("foo").innerText == "foo")
echo(newEntity("bar").innerText == "bar")
echo(newComment("baz").innerText == "")

let y = newXmlTree("x", [
  newText("foo"),
  newXmlTree("y", [
    newText("bar")
  ])
])
echo(y.innerText == "foobar")