X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=parser_tests.js;fp=parser_tests.js;h=45b75e03fece13a95d9033c7c0d135cf146f0aa9;hb=80153058975905b53418f34498b799922f3def07;hp=0000000000000000000000000000000000000000;hpb=5aef791edd38fb3d70a71266ad0b42cf9fb45593;p=peach-html5-editor.git diff --git a/parser_tests.js b/parser_tests.js new file mode 100644 index 0000000..45b75e0 --- /dev/null +++ b/parser_tests.js @@ -0,0 +1,8058 @@ +// Copyright (c) 2006-2015 Jason Woofenden, James Graham, Geoffrey Sneddon, and +// other contributors +// +// The values in the following data structure were extracted from the project at +// https://github.com/html5lib/html5lib-tests which has the following notice: +// +// Copyright (c) 2006-2013 James Graham, Geoffrey Sneddon, and +// other contributors +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// The rest of this file was written by Jason Woofenden in 2015-2016, and is +// released under the terms of the CC0 license: +// http://creativecommons.org/publicdomain/zero/1.0/ and into the public domain + +(function() { +var next_test, peach_parser, run_tests_and_breathe, serialize_els, test_parser, test_results, test_summary, tests; + +tests = [ + { + name: "adoption01.dat #1", + html: "

", + errors: 2, + expected: "| \n| \n| \n| \n|

\n| \n" + }, { + name: "adoption01.dat #2", + html: "1

23

", + errors: 2, + expected: "| \n| \n| \n| \n| \"1\"\n|

\n| \n| \"2\"\n| \"3\"\n" + }, { + name: "adoption01.dat #3", + html: "1", + errors: 2, + expected: "| \n| \n| \n| \n| \"1\"\n|