expected: "| <frame>\n"
}, {
name: "tests_innerHTML_1.dat #85"
+ html: ""
fragment: "html"
expected: "| <head>\n| <body>\n"
}, {
attr_keys.sort() # TODO this should be "lexicographically by UTF-16 code unit"
for k in attr_keys
ret += "#{prefix} #{k}=\"#{el.attrs[k]}\"\n"
- # FIXME template shows as "content" with children below it
- ret += serialize_els el.children, "#{prefix} "
+ if el.name is 'template' # ?check ns
+ ret += "#{prefix} content\n"
+ ret += serialize_els el.children, "#{prefix} "
+ else
+ ret += serialize_els el.children, "#{prefix} "
when wheic.TYPE_TEXT
ret += "#{prefix}\"#{el.text}\"\n"
when wheic.TYPE_COMMENT
# console.log str
console.log "FAILED: \"#{args.name}\""
console.log " Input: #{args.html}"
+ if args.fragment?
+ console.log " Fragment: #{args.fragment}"
console.log " Correct: #{args.expected}"
console.log " Output: #{serialized}"
if parse_errors.length > 0
console.log "passed \"#{args.name}\""
test_results.passed += 1
test_summary = ->
- console.log "Tests passed: #{test_results.passed}"
- console.log "Tests Failed: #{test_results.failed}"
+ console.log "Tests passed: #{test_results.passed}, Tests Failed: #{test_results.failed}"
next_test = 0
start_time = new Date()
loop
if next_test >= tests.length
+ test_summary()
return
test_parser tests[next_test]
next_test += 1
now = new Date()
if now - start_time > 100 # miliseconds
- setTimeout run_tests_and_breathe, 1
+ break
+ setTimeout run_tests_and_breathe, 1
run_tests_and_breathe()
-test_summary()