NPM Dependencies UPDATE
This commit is contained in:
1 parent
d3bc5e34f6
commit
5bfb4ff32a
732 files changed
+13367
-62155
No files matched your search
-33
@@ -1,33 +0,0 @@
|
||||
require(__dirname).test(
|
||||
{ xml: "<root length='12345'></root>"
|
||||
, expect: [
|
||||
["attribute", {
|
||||
name: "length"
|
||||
, value: "12345"
|
||||
, prefix: ""
|
||||
, local: "length"
|
||||
, uri: ""
|
||||
}]
|
||||
, ["opentag", {
|
||||
name: "root"
|
||||
, prefix: ""
|
||||
, local: "root"
|
||||
, uri: ""
|
||||
, attributes: {
|
||||
length: {
|
||||
name: "length"
|
||||
, value: "12345"
|
||||
, prefix: ""
|
||||
, local: "length"
|
||||
, uri: ""
|
||||
}
|
||||
}
|
||||
, ns: {}
|
||||
, isSelfClosing: false
|
||||
}]
|
||||
, ["closetag", "root"]
|
||||
]
|
||||
, strict: true
|
||||
, opt: { xmlns: true }
|
||||
}
|
||||
)
|
||||
-75
@@ -1,75 +0,0 @@
|
||||
// non-strict: no error
|
||||
require(__dirname).test
|
||||
( { xml : '<root attr1="first"attr2="second"/>'
|
||||
|
||||
, expect :
|
||||
[ [ "attribute", { name: 'attr1', value: 'first' } ]
|
||||
, [ "attribute", { name: 'attr2', value: 'second' } ]
|
||||
, [ "opentag", { name: "root", attributes: {attr1: 'first', attr2: 'second'}, isSelfClosing: true } ]
|
||||
, [ "closetag", "root" ]
|
||||
]
|
||||
, strict : false
|
||||
, opt : { lowercase: true }
|
||||
}
|
||||
)
|
||||
|
||||
// strict: should give an error, but still parse
|
||||
require(__dirname).test
|
||||
( { xml : '<root attr1="first"attr2="second"/>'
|
||||
|
||||
, expect :
|
||||
[ [ "attribute", { name: 'attr1', value: 'first' } ]
|
||||
, [ "error", "No whitespace between attributes\nLine: 0\nColumn: 20\nChar: a" ]
|
||||
, [ "attribute", { name: 'attr2', value: 'second' } ]
|
||||
, [ "opentag", { name: "root", attributes: {attr1: 'first', attr2: 'second'}, isSelfClosing: true } ]
|
||||
, [ "closetag", "root" ]
|
||||
]
|
||||
, strict : true
|
||||
, opt : { }
|
||||
}
|
||||
)
|
||||
|
||||
// strict: other cases should still pass
|
||||
require(__dirname).test
|
||||
( { xml : '<root attr1="first" attr2="second"/>'
|
||||
|
||||
, expect :
|
||||
[ [ "attribute", { name: 'attr1', value: 'first' } ]
|
||||
, [ "attribute", { name: 'attr2', value: 'second' } ]
|
||||
, [ "opentag", { name: "root", attributes: {attr1: 'first', attr2: 'second'}, isSelfClosing: true } ]
|
||||
, [ "closetag", "root" ]
|
||||
]
|
||||
, strict : true
|
||||
, opt : { }
|
||||
}
|
||||
)
|
||||
|
||||
// strict: other cases should still pass
|
||||
require(__dirname).test
|
||||
( { xml : '<root attr1="first"\nattr2="second"/>'
|
||||
|
||||
, expect :
|
||||
[ [ "attribute", { name: 'attr1', value: 'first' } ]
|
||||
, [ "attribute", { name: 'attr2', value: 'second' } ]
|
||||
, [ "opentag", { name: "root", attributes: {attr1: 'first', attr2: 'second'}, isSelfClosing: true } ]
|
||||
, [ "closetag", "root" ]
|
||||
]
|
||||
, strict : true
|
||||
, opt : { }
|
||||
}
|
||||
)
|
||||
|
||||
// strict: other cases should still pass
|
||||
require(__dirname).test
|
||||
( { xml : '<root attr1="first" attr2="second"/>'
|
||||
|
||||
, expect :
|
||||
[ [ "attribute", { name: 'attr1', value: 'first' } ]
|
||||
, [ "attribute", { name: 'attr2', value: 'second' } ]
|
||||
, [ "opentag", { name: "root", attributes: {attr1: 'first', attr2: 'second'}, isSelfClosing: true } ]
|
||||
, [ "closetag", "root" ]
|
||||
]
|
||||
, strict : true
|
||||
, opt : { }
|
||||
}
|
||||
)
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
var assert = require('assert');
|
||||
var saxStream = require('../lib/sax').createStream();
|
||||
assert.doesNotThrow(function() {
|
||||
saxStream.end();
|
||||
});
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
var parser = require(__dirname).test({
|
||||
expect: [
|
||||
['opentag', {'name':'T', attributes:{}, isSelfClosing: false}],
|
||||
['text', 'flush'],
|
||||
['text', 'rest'],
|
||||
['closetag', 'T'],
|
||||
]
|
||||
});
|
||||
|
||||
parser.write('<T>flush');
|
||||
parser.flush();
|
||||
parser.write('rest</T>');
|
||||
parser.close();
|
||||
-32
@@ -1,32 +0,0 @@
|
||||
var assert = require('assert')
|
||||
var saxStream = require('../lib/sax').createStream()
|
||||
|
||||
var b = new Buffer('误')
|
||||
|
||||
saxStream.on('text', function(text) {
|
||||
assert.equal(text, b.toString())
|
||||
})
|
||||
|
||||
saxStream.write(new Buffer('<test><a>'))
|
||||
saxStream.write(b.slice(0, 1))
|
||||
saxStream.write(b.slice(1))
|
||||
saxStream.write(new Buffer('</a><b>'))
|
||||
saxStream.write(b.slice(0, 2))
|
||||
saxStream.write(b.slice(2))
|
||||
saxStream.write(new Buffer('</b><c>'))
|
||||
saxStream.write(b)
|
||||
saxStream.write(new Buffer('</c>'))
|
||||
saxStream.write(Buffer.concat([new Buffer('<d>'), b.slice(0, 1)]))
|
||||
saxStream.end(Buffer.concat([b.slice(1), new Buffer('</d></test>')]))
|
||||
|
||||
var saxStream2 = require('../lib/sax').createStream()
|
||||
|
||||
saxStream2.on('text', function(text) {
|
||||
assert.equal(text, '�')
|
||||
});
|
||||
|
||||
saxStream2.write(new Buffer('<e>'));
|
||||
saxStream2.write(new Buffer([0xC0]));
|
||||
saxStream2.write(new Buffer('</e>'));
|
||||
saxStream2.write(Buffer.concat([new Buffer('<f>'), b.slice(0,1)]));
|
||||
saxStream2.end();
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
|
||||
require(__dirname).test
|
||||
( { xml :
|
||||
"<xmlns/>"
|
||||
, expect :
|
||||
[ [ "opentag", { name: "xmlns", uri: "", prefix: "", local: "xmlns",
|
||||
attributes: {}, ns: {},
|
||||
isSelfClosing: true}
|
||||
],
|
||||
["closetag", "xmlns"]
|
||||
]
|
||||
, strict : true
|
||||
, opt : { xmlns: true }
|
||||
}
|
||||
);
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
require(__dirname).test(
|
||||
{ strict : true
|
||||
, opt : { xmlns: true }
|
||||
, expect :
|
||||
[ [ "error", "Unbound namespace prefix: \"unbound:root\"\nLine: 0\nColumn: 15\nChar: >"]
|
||||
, [ "opentag", { name: "unbound:root", uri: "unbound", prefix: "unbound", local: "root"
|
||||
, attributes: {}, ns: {}, isSelfClosing: true } ]
|
||||
, [ "closetag", "unbound:root" ]
|
||||
]
|
||||
}
|
||||
).write("<unbound:root/>");
|
||||
|
||||
require(__dirname).test(
|
||||
{ strict : true
|
||||
, opt : { xmlns: true }
|
||||
, expect :
|
||||
[ [ "opennamespace", { prefix: "unbound", uri: "someuri" } ]
|
||||
, [ "attribute", { name: 'xmlns:unbound', value: 'someuri'
|
||||
, prefix: 'xmlns', local: 'unbound'
|
||||
, uri: 'http://www.w3.org/2000/xmlns/' } ]
|
||||
, [ "opentag", { name: "unbound:root", uri: "someuri", prefix: "unbound", local: "root"
|
||||
, attributes: { 'xmlns:unbound': {
|
||||
name: 'xmlns:unbound'
|
||||
, value: 'someuri'
|
||||
, prefix: 'xmlns'
|
||||
, local: 'unbound'
|
||||
, uri: 'http://www.w3.org/2000/xmlns/' } }
|
||||
, ns: { "unbound": "someuri" }, isSelfClosing: true } ]
|
||||
, [ "closetag", "unbound:root" ]
|
||||
, [ "closenamespace", { prefix: 'unbound', uri: 'someuri' }]
|
||||
]
|
||||
}
|
||||
).write("<unbound:root xmlns:unbound=\"someuri\"/>");
|
||||
Reference in new issue
Block a user