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