OLD | NEW |
1 function createHTMLDocuments(checkDoc) { | 1 function createHTMLDocuments(checkDoc) { |
2 var tests = [ | 2 var tests = [ |
3 ["", "", ""], | 3 ["", "", ""], |
4 [null, "null", "null"], | 4 [null, "null", "null"], |
5 [undefined, undefined, ""], | 5 [undefined, undefined, ""], |
6 ["foo bar baz", "foo bar baz", "foo bar baz"], | 6 ["foo bar baz", "foo bar baz", "foo bar baz"], |
7 ["foo\t\tbar baz", "foo\t\tbar baz", "foo bar baz"], | 7 ["foo\t\tbar baz", "foo\t\tbar baz", "foo bar baz"], |
8 ["foo\n\nbar baz", "foo\n\nbar baz", "foo bar baz"], | 8 ["foo\n\nbar baz", "foo\n\nbar baz", "foo bar baz"], |
9 ["foo\f\fbar baz", "foo\f\fbar baz", "foo bar baz"], | 9 ["foo\f\fbar baz", "foo\f\fbar baz", "foo bar baz"], |
10 ["foo\r\rbar baz", "foo\r\rbar baz", "foo bar baz"], | 10 ["foo\r\rbar baz", "foo\r\rbar baz", "foo bar baz"], |
11 ] | 11 ] |
12 | 12 |
13 tests.forEach(function(t, i) { | 13 tests.forEach(function(t, i) { |
14 var title = t[0], expectedtitle = t[1], normalizedtitle = t[2] | 14 var title = t[0], expectedtitle = t[1], normalizedtitle = t[2] |
15 test(function() { | 15 test(function() { |
16 var doc = document.implementation.createHTMLDocument(title); | 16 var doc = document.implementation.createHTMLDocument(title); |
17 checkDoc(doc, expectedtitle, normalizedtitle) | 17 checkDoc(doc, expectedtitle, normalizedtitle) |
18 }, "createHTMLDocument test " + i + ": " + t.map(function(el) { return forma
t_value(el) })) | 18 }, "createHTMLDocument test " + i + ": " + t.map(function(el) { return forma
t_value(el) })) |
19 }) | 19 }) |
20 | 20 |
21 test(function() { | 21 test(function() { |
22 var doc = document.implementation.createHTMLDocument(); | 22 var doc = document.implementation.createHTMLDocument(); |
23 checkDoc(doc, undefined, "") | 23 checkDoc(doc, undefined, "") |
24 }, "Missing title argument"); | 24 }, "Missing title argument"); |
25 } | 25 } |
OLD | NEW |