OLD | NEW |
1 library parser_test; | 1 library parser_test; |
2 | 2 |
| 3 import 'dart:convert; |
3 import 'dart:io'; | 4 import 'dart:io'; |
4 import 'dart:json' as json; | |
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'; | 10 import 'package:html5lib/src/constants.dart'; |
11 import 'package:html5lib/src/inputstream.dart' as inputstream; | 11 import 'package:html5lib/src/inputstream.dart' as inputstream; |
12 import 'package:html5lib/src/tokenizer.dart'; | 12 import 'package:html5lib/src/tokenizer.dart'; |
13 import 'package:html5lib/src/utils.dart'; | 13 import 'package:html5lib/src/utils.dart'; |
14 import 'support.dart'; | 14 import 'support.dart'; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 } | 107 } |
108 | 108 |
109 index++; | 109 index++; |
110 } | 110 } |
111 }); | 111 }); |
112 } | 112 } |
113 } | 113 } |
114 | 114 |
115 /** Extract the name for the test based on the test input data. */ | 115 /** Extract the name for the test based on the test input data. */ |
116 _nameFor(String input) { | 116 _nameFor(String input) { |
117 // Using json.parse to unescape other unicode characters | 117 // Using JSON.decode to unescape other unicode characters |
118 var escapeQuote = input | 118 var escapeQuote = input |
119 .replaceAll(new RegExp('\\\\.'), '_') | 119 .replaceAll(new RegExp('\\\\.'), '_') |
120 .replaceAll(new RegExp('\u0000'), '_') | 120 .replaceAll(new RegExp('\u0000'), '_') |
121 .replaceAll('"', '\\"') | 121 .replaceAll('"', '\\"') |
122 .replaceAll(new RegExp('[\n\r\t]'),'_'); | 122 .replaceAll(new RegExp('[\n\r\t]'),'_'); |
123 return json.parse('"$escapeQuote"'); | 123 return JSON.decode('"$escapeQuote"'); |
124 } | 124 } |
OLD | NEW |