OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | |
2 // for details. All rights reserved. Use of this source code is governed by a | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 library test.src.task.html_test; | |
6 | |
7 import 'package:analyzer/src/context/cache.dart'; | |
8 import 'package:analyzer/src/generated/ast.dart'; | |
9 import 'package:analyzer/src/generated/constant.dart'; | |
10 import 'package:analyzer/src/generated/element.dart'; | |
11 import 'package:analyzer/src/generated/engine.dart' | |
12 show AnalysisOptionsImpl, CacheState; | |
13 import 'package:analyzer/src/generated/error.dart'; | |
14 import 'package:analyzer/src/generated/resolver.dart'; | |
15 import 'package:analyzer/src/generated/sdk.dart'; | |
16 import 'package:analyzer/src/generated/source.dart'; | |
17 import 'package:analyzer/src/task/html.dart'; | |
18 import 'package:analyzer/task/dart.dart'; | |
19 import 'package:analyzer/task/general.dart'; | |
20 import 'package:analyzer/task/html.dart'; | |
21 import 'package:analyzer/task/model.dart'; | |
22 import 'package:unittest/unittest.dart'; | |
23 | |
24 import '../../generated/test_support.dart'; | |
25 import '../../reflective_tests.dart'; | |
26 import '../context/abstract_context.dart'; | |
27 | |
28 main() { | |
29 groupSep = ' | '; | |
30 runReflectiveTests(ParseHtmlTaskTest); | |
31 } | |
32 | |
33 @reflectiveTest | |
34 class ParseHtmlTaskTest extends AbstractContextTest { | |
35 test_buildInputs() { | |
36 Source source = newSource('/test.html'); | |
37 Map<String, TaskInput> inputs = ParseHtmlTask.buildInputs(source); | |
38 expect(inputs, isNotNull); | |
39 expect(inputs.keys, unorderedEquals([ParseHtmlTask.CONTENT_INPUT_NAME])); | |
40 } | |
41 | |
42 test_constructor() { | |
43 Source source = newSource('/test.html'); | |
44 ParseHtmlTask task = new ParseHtmlTask(context, source); | |
45 expect(task, isNotNull); | |
46 expect(task.context, context); | |
47 expect(task.target, source); | |
48 } | |
49 | |
50 test_createTask() { | |
51 Source source = newSource('/test.html'); | |
52 ParseHtmlTask task = ParseHtmlTask.createTask(context, source); | |
53 expect(task, isNotNull); | |
54 expect(task.context, context); | |
55 expect(task.target, source); | |
56 } | |
57 | |
58 test_description() { | |
59 Source source = newSource('/test.html'); | |
60 ParseHtmlTask task = new ParseHtmlTask(null, source); | |
61 expect(task.description, isNotNull); | |
62 } | |
63 | |
64 test_descriptor() { | |
65 TaskDescriptor descriptor = ParseHtmlTask.DESCRIPTOR; | |
66 expect(descriptor, isNotNull); | |
67 } | |
68 | |
69 test_perform() { | |
70 AnalysisTarget target = newSource('/test.html', r''' | |
71 <html> | |
72 <head> | |
73 <title 'test page'/> | |
74 </head> | |
75 <body> | |
76 Test | |
77 </body> | |
78 </html> | |
79 '''); | |
80 computeResult(target, DOCUMENT); | |
scheglov
2015/06/11 20:17:30
Would be nice to have a test for not empty DOCUMEN
Brian Wilkerson
2015/06/11 20:23:29
Done
| |
81 expect(task, new isInstanceOf<ParseHtmlTask>()); | |
82 } | |
83 } | |
OLD | NEW |