Skip to content

community/njs: fix tests with libxml2

mio requested to merge mio/aports:njs into master

Fix xml tests with libxml2 >=2.13.

Original errors:

njs("const xml = require('xml');let data = `<note><to b="bar" a= "foo" >Tove</to><from>Jani</from></note>`;let doc = xml.parse(data);var doc2 = xml.parse(`<n0:pdu xmlns:n0="http://a"></n0:pdu>`);doc.note.$tags = [doc.note.to, doc2];(new TextDecoder).decode(xml.c14n(doc))")
expected: "<note xmlns:n0="http://a"><to a="foo" b="bar">Tove</to><n0:pdu></n0:pdu></note>"
     got: "<note></note>"
njs("const xml = require('xml');let data = `<note><to b="bar" a= "foo" >Tove</to><from>Jani</from></note>`;let doc = xml.parse(data);var doc2 = xml.parse(`<n0:pdu xmlns:n0="http://a"></n0:pdu>`);doc.note.$tags = [doc2, doc.note.to];(new TextDecoder).decode(xml.c14n(doc))")
expected: "<note xmlns:n0="http://a"><n0:pdu></n0:pdu><to a="foo" b="bar">Tove</to></note>"
     got: "<note></note>"
xml tests: FAILED [44/46]

Merge request reports

Loading