| OLD | NEW |
| 1 library parser_test; | 1 library parser_test; |
| 2 | 2 |
| 3 import 'dart:convert'; | 3 import 'dart:convert'; |
| 4 import 'dart:io'; | 4 import 'dart:io'; |
| 5 import 'package:path/path.dart' as pathos; | 5 import 'package:path/path.dart' as pathos; |
| 6 import 'package:unittest/unittest.dart'; | 6 import 'package:unittest/unittest.dart'; |
| 7 import 'package:html5lib/dom.dart'; | 7 import 'package:html5lib/dom.dart'; |
| 8 import 'package:html5lib/parser.dart'; | 8 import 'package:html5lib/parser.dart'; |
| 9 import 'package:html5lib/parser_console.dart' as parser_console; | 9 import 'package:html5lib/parser_console.dart' as parser_console; |
| 10 import 'package:html5lib/src/constants.dart'; | |
| 11 import 'package:html5lib/src/inputstream.dart' as inputstream; | 10 import 'package:html5lib/src/inputstream.dart' as inputstream; |
| 12 import 'package:html5lib/src/tokenizer.dart'; | |
| 13 import 'package:html5lib/src/utils.dart'; | |
| 14 import 'support.dart'; | 11 import 'support.dart'; |
| 15 | 12 |
| 16 // Run the parse error checks | 13 // Run the parse error checks |
| 17 // TODO(jmesserly): presumably we want this on by default? | 14 // TODO(jmesserly): presumably we want this on by default? |
| 18 final checkParseErrors = false; | 15 final checkParseErrors = false; |
| 19 | 16 |
| 20 String namespaceHtml(String expected) { | 17 String namespaceHtml(String expected) { |
| 21 // TODO(jmesserly): this is a workaround for http://dartbug.com/2979 | 18 // TODO(jmesserly): this is a workaround for http://dartbug.com/2979 |
| 22 // We can't do regex replace directly =\ | 19 // We can't do regex replace directly =\ |
| 23 // final namespaceExpected = new RegExp(@"^(\s*)<(\S+)>", multiLine: true); | 20 // final namespaceExpected = new RegExp(@"^(\s*)<(\S+)>", multiLine: true); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 /** Extract the name for the test based on the test input data. */ | 112 /** Extract the name for the test based on the test input data. */ |
| 116 _nameFor(String input) { | 113 _nameFor(String input) { |
| 117 // Using JSON.decode to unescape other unicode characters | 114 // Using JSON.decode to unescape other unicode characters |
| 118 var escapeQuote = input | 115 var escapeQuote = input |
| 119 .replaceAll(new RegExp('\\\\.'), '_') | 116 .replaceAll(new RegExp('\\\\.'), '_') |
| 120 .replaceAll(new RegExp('\u0000'), '_') | 117 .replaceAll(new RegExp('\u0000'), '_') |
| 121 .replaceAll('"', '\\"') | 118 .replaceAll('"', '\\"') |
| 122 .replaceAll(new RegExp('[\n\r\t]'),'_'); | 119 .replaceAll(new RegExp('[\n\r\t]'),'_'); |
| 123 return JSON.decode('"$escapeQuote"'); | 120 return JSON.decode('"$escapeQuote"'); |
| 124 } | 121 } |
| OLD | NEW |