JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
handle nulls properly
[peach-html5-editor.git] / test.coffee
index 69fb3f6..327f800 100644 (file)
@@ -1607,7 +1607,7 @@ tests = [
                name: "main-element.dat #3"
                html: "<!DOCTYPE html>xxx<svg><x><g><a><main><b>"
                errors: 2
-               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"xxx\"\n|     <svg svg>\n|       <svg x>\n|         <svg g>\n|           <svg a>\n|             <svg main>\n|     <b>\n"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"xxx\"\n|     <svg svg>\n|       <svg x>\n|         <svg g>\n|           <svg a>\n|     <main>\n|       <b>\n"
        }, {
                name: "math.dat #1"
                html: "<math><tr><td><mo><tr>"
@@ -2697,7 +2697,7 @@ tests = [
        }, {
                name: "template.dat #108"
                html: "<template><a><table><a>"
-               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <a>\n|           <a>\n|           <table>\n|   <body>"
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <a>\n|           <a>\n|           <table>\n|   <body>\n"
        }, {
                name: "tests10.dat #1"
                html: "<!DOCTYPE html><svg></svg>"
@@ -7953,7 +7953,7 @@ serialize_els = (els, prefix = '| ') ->
                                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"
-                               if el.name is 'template' # ?check ns
+                               if el.name is 'template' and el.namespace is wheic.NS_HTML
                                        ret += "#{prefix}  content\n"
                                        ret += serialize_els el.children, "#{prefix}    "
                                else
@@ -7972,11 +7972,14 @@ serialize_els = (els, prefix = '| ') ->
                                ret += "#{prefix}UNKNOWN TAG TYPE #{el.type}"
        return ret
 
-test_results = passed: 0, failed: 0, fragment: 0
+test_results = passed: 0, failed: 0, fragment: 0, pending: 0
 test_parser = (args) ->
        if args.fragment? # hide fragment tests for now
                test_results.fragment += 1
                return
+       if args.name.substr(0, 20) is "pending-spec-changes" # hide for now
+               test_results.pending += 1
+               return
        wheic.debug_log_reset()
        parse_errors = []
        args.error_cb = (i) ->
@@ -8003,7 +8006,7 @@ test_parser = (args) ->
                test_results.passed += 1
                # console.log "passed \"#{args.name}\""
 test_summary = ->
-       console.log "Tests passed: #{test_results.passed}, Failed: #{test_results.failed}, ignored: #{test_results.fragment}"
+       console.log "Tests passed: #{test_results.passed}, Failed: #{test_results.failed}, fragment: #{test_results.fragment}, pending: #{test_results.pending}"
 
 
 next_test = 0