File: level3.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 (20 lines) | stat: -rw-r--r-- 593 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
suite 'DOM Level 3:', ->
  test 'DOMImplementation', ->
    ok( builder.implementation.hasFeature "XML", "3.0" )

  test 'Document', ->
    node = xml('root', { version: '1.1', encoding: 'UTF-8', standalone: true })

    eq( node.doc().xmlEncoding, 'UTF-8' )
    eq( node.doc().xmlVersion, '1.1' )
    eq( node.doc().xmlStandalone, true )

  test 'Node', ->
    node = xml('root').ele('node').txt('text1').txt('text2')

    eq( node.textContent, 'text1text2' )

  test 'Text', ->
    node = xml('root').ele('node').txt('text1').txt('text2')

    eq( node.children[0].wholeText, 'text1text2' )