mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Add a non-ASCII test to CharacterData-insertData.html.
This commit is contained in:
parent
61e8351f28
commit
6efab116e7
2 changed files with 11 additions and 8 deletions
|
@ -9,14 +9,7 @@
|
||||||
<script>
|
<script>
|
||||||
test(function() {
|
test(function() {
|
||||||
var a = document.getElementsByTagName('p')[0].childNodes[0];
|
var a = document.getElementsByTagName('p')[0].childNodes[0];
|
||||||
a.data = "This is the character data, append more 資料,測試資料";
|
a.data = "This is the character data test, append more 資料,更多測試資料";
|
||||||
|
|
||||||
// insert test non-utf8
|
|
||||||
a.insertData(26, " test");
|
|
||||||
assert_equals(a.data, "This is the character data test, append more 資料,測試資料");
|
|
||||||
// insert test utf8
|
|
||||||
a.insertData(48, "更多");
|
|
||||||
assert_equals(a.data, "This is the character data test, append more 資料,更多測試資料");
|
|
||||||
|
|
||||||
// delete test non-utf8
|
// delete test non-utf8
|
||||||
a.deleteData(40, 5);
|
a.deleteData(40, 5);
|
||||||
|
|
|
@ -31,6 +31,16 @@ function testNode(create, type) {
|
||||||
node.insertData(4, "ing")
|
node.insertData(4, "ing")
|
||||||
assert_equals(node.data, "testing")
|
assert_equals(node.data, "testing")
|
||||||
}, type + ".insertData() at the end")
|
}, type + ".insertData() at the end")
|
||||||
|
|
||||||
|
test(function() {
|
||||||
|
var node = create()
|
||||||
|
node.data = "This is the character data, append more 資料,測試資料";
|
||||||
|
|
||||||
|
node.insertData(26, " test");
|
||||||
|
assert_equals(node.data, "This is the character data test, append more 資料,測試資料");
|
||||||
|
node.insertData(48, "更多");
|
||||||
|
assert_equals(node.data, "This is the character data test, append more 資料,更多測試資料");
|
||||||
|
}, type + ".insertData() with non-ascii data")
|
||||||
}
|
}
|
||||||
|
|
||||||
testNode(function() { return document.createTextNode("test") }, "Text")
|
testNode(function() { return document.createTextNode("test") }, "Text")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue