-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Notably the atStart parameter is no longer computed and passed to the test. Those places that need it need to compute it themselves. In fact most places that used it don't need it. The ``isNameStartChar`` checks were mostly redundant as the necessary check on the first character of names was done elsewhere.
- Loading branch information
Showing
2 changed files
with
114 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,93 +1,97 @@ | ||
"use strict"; | ||
|
||
require(".").test({ | ||
name: "openstarttag (xmlns true)", | ||
xml: "<root length='12345'></root>", | ||
expect: [ | ||
[ | ||
"opentagstart", | ||
{ | ||
name: "root", | ||
ns: {}, | ||
attributes: {}, | ||
}, | ||
], | ||
[ | ||
"opentag", | ||
{ | ||
name: "root", | ||
prefix: "", | ||
local: "root", | ||
uri: "", | ||
attributes: { | ||
length: { | ||
name: "length", | ||
value: "12345", | ||
prefix: "", | ||
local: "length", | ||
uri: "", | ||
const { test } = require("."); | ||
|
||
describe("openstarttag", () => { | ||
test({ | ||
name: "good name, xmlns true", | ||
xml: "<root length='12345'></root>", | ||
expect: [ | ||
[ | ||
"opentagstart", | ||
{ | ||
name: "root", | ||
ns: {}, | ||
attributes: {}, | ||
}, | ||
], | ||
[ | ||
"opentag", | ||
{ | ||
name: "root", | ||
prefix: "", | ||
local: "root", | ||
uri: "", | ||
attributes: { | ||
length: { | ||
name: "length", | ||
value: "12345", | ||
prefix: "", | ||
local: "length", | ||
uri: "", | ||
}, | ||
}, | ||
ns: {}, | ||
isSelfClosing: false, | ||
}, | ||
ns: {}, | ||
isSelfClosing: false, | ||
}, | ||
], | ||
[ | ||
"closetag", | ||
{ | ||
name: "root", | ||
prefix: "", | ||
local: "root", | ||
uri: "", | ||
attributes: { | ||
length: { | ||
name: "length", | ||
value: "12345", | ||
prefix: "", | ||
local: "length", | ||
uri: "", | ||
], | ||
[ | ||
"closetag", | ||
{ | ||
name: "root", | ||
prefix: "", | ||
local: "root", | ||
uri: "", | ||
attributes: { | ||
length: { | ||
name: "length", | ||
value: "12345", | ||
prefix: "", | ||
local: "length", | ||
uri: "", | ||
}, | ||
}, | ||
ns: {}, | ||
isSelfClosing: false, | ||
}, | ||
ns: {}, | ||
isSelfClosing: false, | ||
}, | ||
], | ||
], | ||
], | ||
opt: { | ||
xmlns: true, | ||
}, | ||
}); | ||
opt: { | ||
xmlns: true, | ||
}, | ||
}); | ||
|
||
require(".").test({ | ||
name: "openstarttag (xmlns false)", | ||
xml: "<root length='12345'></root>", | ||
expect: [ | ||
[ | ||
"opentagstart", | ||
{ | ||
name: "root", | ||
attributes: {}, | ||
}, | ||
], | ||
[ | ||
"opentag", | ||
{ | ||
name: "root", | ||
attributes: { | ||
length: "12345", | ||
test({ | ||
name: "good name, xmlns false", | ||
xml: "<root length='12345'></root>", | ||
expect: [ | ||
[ | ||
"opentagstart", | ||
{ | ||
name: "root", | ||
attributes: {}, | ||
}, | ||
isSelfClosing: false, | ||
}, | ||
], | ||
[ | ||
"closetag", | ||
{ | ||
name: "root", | ||
attributes: { | ||
length: "12345", | ||
], | ||
[ | ||
"opentag", | ||
{ | ||
name: "root", | ||
attributes: { | ||
length: "12345", | ||
}, | ||
isSelfClosing: false, | ||
}, | ||
], | ||
[ | ||
"closetag", | ||
{ | ||
name: "root", | ||
attributes: { | ||
length: "12345", | ||
}, | ||
isSelfClosing: false, | ||
}, | ||
isSelfClosing: false, | ||
}, | ||
], | ||
], | ||
], | ||
}); | ||
}); |