}, {
name: "webkit02.dat #2"
html: "<p id=\"status\"><noscript><strong>A</strong></noscript><span>B</span></p>"
+ scripting: true
errors: 1
expected: "| <html>\n| <head>\n| <body>\n| <p>\n| id=\"status\"\n| <noscript>\n| \"<strong>A</strong>\"\n| <span>\n| \"B\"\n"
}, {
name: "webkit02.dat #3"
html: "<p id=\"status\"><noscript><strong>A</strong></noscript><span>B</span></p>"
+ scripting: false
errors: 1
expected: "| <html>\n| <head>\n| <body>\n| <p>\n| id=\"status\"\n| <noscript>\n| <strong>\n| \"A\"\n| <span>\n| \"B\"\n"
}, {
ret += "#{prefix}UNKNOWN TAG TYPE #{el.type}"
return ret
-test_results = passed: 0, failed: 0
+test_results = passed: 0, failed: 0, fragment: 0
test_parser = (args) ->
+ if args.fragment? # hide fragment tests for now
+ test_results.fragment += 1
+ return
wheic.debug_log_reset()
parse_errors = []
- errors_cb = (i) ->
+ args.error_cb = (i) ->
parse_errors.push i
prev_node_id = 0 # reset counter
- parsed = wheic.parse_html args.html, errors_cb
+ parsed = wheic.parse_html args
serialized = serialize_els parsed
if serialized isnt args.expected
#wheic.debug_log_each (str) ->
console.log "passed \"#{args.name}\""
test_results.passed += 1
test_summary = ->
- console.log "Tests passed: #{test_results.passed}, Tests Failed: #{test_results.failed}"
+ console.log "Tests passed: #{test_results.passed}, Failed: #{test_results.failed}, ignored: #{test_results.fragment}"
next_test = 0