File: comment.coffee

package info (click to toggle)
node-xml2js 0.4.23%2B~cs15.4.0%2Bdfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,380 kB
  • sloc: xml: 117; javascript: 7; makefile: 2
file content (14 lines) | stat: -rw-r--r-- 399 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
suite 'Comments', ->
  test 'Nothing gets escaped', ->
    eq(
      xml('comment', { headless: true })
        .comment('<>\'"&\t\n\r').end()
      '<comment><!-- <>\'"&\t\n\r --></comment>'
    )

  test 'Comments before and after root', ->
    eq(
      xml('comment', { headless: true })
        .commentBefore('pre').commentAfter('post').end()
      '<!-- pre --><comment/><!-- post -->'
    )