| OLD | NEW |
| 1 /** Additional feature tests that aren't based on test data. */ | 1 /** Additional feature tests that aren't based on test data. */ |
| 2 library parser_feature_test; | 2 library parser_feature_test; |
| 3 | 3 |
| 4 import 'package:unittest/unittest.dart'; | 4 import 'package:unittest/unittest.dart'; |
| 5 import 'package:html5lib/dom.dart'; | 5 import 'package:html5lib/dom.dart'; |
| 6 import 'package:html5lib/dom_parsing.dart'; | |
| 7 import 'package:html5lib/parser.dart'; | 6 import 'package:html5lib/parser.dart'; |
| 8 import 'package:html5lib/src/constants.dart'; | 7 import 'package:html5lib/src/constants.dart'; |
| 9 import 'package:html5lib/src/tokenizer.dart'; | |
| 10 import 'package:html5lib/src/treebuilder.dart'; | 8 import 'package:html5lib/src/treebuilder.dart'; |
| 11 | 9 |
| 12 main() { | 10 main() { |
| 13 test('doctype is cloneable', () { | 11 test('doctype is cloneable', () { |
| 14 var doc = parse('<!DOCTYPE HTML>'); | 12 var doc = parse('<!DOCTYPE HTML>'); |
| 15 DocumentType doctype = doc.nodes[0]; | 13 DocumentType doctype = doc.nodes[0]; |
| 16 expect(doctype.clone().outerHtml, '<!DOCTYPE html>'); | 14 expect(doctype.clone().outerHtml, '<!DOCTYPE html>'); |
| 17 }); | 15 }); |
| 18 | 16 |
| 19 test('line counter', () { | 17 test('line counter', () { |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 expect(doc.body.innerHtml, 'foo'); | 240 expect(doc.body.innerHtml, 'foo'); |
| 243 expect(parser.errors.length, 1); | 241 expect(parser.errors.length, 1); |
| 244 expect(parser.errors[0].errorCode, 'expected-doctype-but-got-chars'); | 242 expect(parser.errors[0].errorCode, 'expected-doctype-but-got-chars'); |
| 245 expect(parser.errors[0].message, | 243 expect(parser.errors[0].message, |
| 246 'Unexpected non-space characters. Expected DOCTYPE.'); | 244 'Unexpected non-space characters. Expected DOCTYPE.'); |
| 247 expect(parser.errors[0].toString(), | 245 expect(parser.errors[0].toString(), |
| 248 'ParserError:1:4: Unexpected non-space characters. ' | 246 'ParserError:1:4: Unexpected non-space characters. ' |
| 249 'Expected DOCTYPE.'); | 247 'Expected DOCTYPE.'); |
| 250 }); | 248 }); |
| 251 } | 249 } |
| OLD | NEW |