mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 10:07:15 +02:00
Tests: Import WPTs to prevent optional string argument regressions
This commit is contained in:
committed by
Tim Ledbetter
parent
a25ff8d46e
commit
f2a406f8cc
Notes:
github-actions[bot]
2024-11-29 20:23:57 +00:00
Author: https://github.com/shlyakpavel Commit: https://github.com/LadybirdBrowser/ladybird/commit/f2a406f8cc9 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2630 Reviewed-by: https://github.com/tcl3 ✅
@@ -0,0 +1,25 @@
|
||||
function createHTMLDocuments(checkDoc) {
|
||||
var tests = [
|
||||
["", "", ""],
|
||||
[null, "null", "null"],
|
||||
[undefined, undefined, ""],
|
||||
["foo bar baz", "foo bar baz", "foo bar baz"],
|
||||
["foo\t\tbar baz", "foo\t\tbar baz", "foo bar baz"],
|
||||
["foo\n\nbar baz", "foo\n\nbar baz", "foo bar baz"],
|
||||
["foo\f\fbar baz", "foo\f\fbar baz", "foo bar baz"],
|
||||
["foo\r\rbar baz", "foo\r\rbar baz", "foo bar baz"],
|
||||
]
|
||||
|
||||
tests.forEach(function(t, i) {
|
||||
var title = t[0], expectedtitle = t[1], normalizedtitle = t[2]
|
||||
test(function() {
|
||||
var doc = document.implementation.createHTMLDocument(title);
|
||||
checkDoc(doc, expectedtitle, normalizedtitle)
|
||||
}, "createHTMLDocument test " + i + ": " + t.map(function(el) { return format_value(el) }))
|
||||
})
|
||||
|
||||
test(function() {
|
||||
var doc = document.implementation.createHTMLDocument();
|
||||
checkDoc(doc, undefined, "")
|
||||
}, "Missing title argument");
|
||||
}
|
||||
Reference in New Issue
Block a user