summary refs log tree commit diff stats
path: root/tests/xml/ttree_delete.nim
blob: 32b477839460d0bef648a9e91c0b2d0100ccc85b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
discard """
  output: '''
<xml>
  <head>
    <div>Some text</div>
    <div>Some more text </div>
  </head>
  <body>
    <div>Some text in body</div>
    <div>Some more text in body </div>
  </body>
</xml>
'''
"""

# Test xmltree add/insert/delete/replace operations
import xmlparser
import xmltree
let initialDocBase = """
<xml>
  <head>
    <div>Some text</div>
    <div>Some more text </div>
  </head>
  <tag>
    <div>MORE TEXT </div>
    <div>MORE TEXT Some more text</div>
  </tag>
  <tag>
    <div>MORE TEXT </div>
    <div>MORE TEXT Some more text</div>
  </tag>
  <body>
    <div>Some text in body</div>
    <div>Some more text in body </div>
  </body>
</xml>
"""
var initialDocBaseTree = parseXml(initialDocBase)

proc test_delete() =
  var testDoc = initialDocBaseTree
  
  testDoc.delete(1..2)
  echo $testDoc

test_delete()