Add tests for CharacterDataMethods with non-BMP code points

This commit is contained in:
Simon Sapin 2015-08-01 09:09:53 +02:00
parent 006dd1002f
commit dcc8f63d52
8 changed files with 143 additions and 2 deletions

View file

@ -121,6 +121,15 @@ function testNode(create, type) {
assert_equals(node.substringData(12, 4), "char")
assert_equals(node.substringData(39, 2), "資料")
}, type + ".substringData() with non-ASCII data")
test(function() {
var node = create()
assert_equals(node.data, "test")
node.data = "🌠 test 🌠 TEST"
assert_equals(node.substringData(5, 8), "st 🌠 TE") // Counting UTF-16 code units
}, type + ".substringData() with non-BMP data")
}
testNode(function() { return document.createTextNode("test") }, "Text")