Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Side by Side Diff: pkg/analyzer/test/src/task/yaml_test.dart

Issue 1622313003: Add minimal yaml support to the engine (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/analyzer/test/src/task/test_all.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2016, 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 analyzer.test.src.task.yaml_test;
6
7 import 'package:analyzer/src/generated/source.dart';
8 import 'package:analyzer/src/task/yaml.dart';
9 import 'package:analyzer/task/yaml.dart';
10 import 'package:unittest/unittest.dart';
11
12 import '../../reflective_tests.dart';
13 import '../../utils.dart';
14 import '../context/abstract_context.dart';
15
16 main() {
17 initializeTestEnvironment();
18 runReflectiveTests(ParseYamlTaskTest);
19 }
20
21 isInstanceOf isParseYamlTask = new isInstanceOf<ParseYamlTask>();
22
23 @reflectiveTest
24 class ParseYamlTaskTest extends AbstractContextTest {
25 Source source;
26
27 test_perform() {
28 _performParseTask(r'''
29 rules:
30 style_guide:
31 camel_case_types: false
32 ''');
33 expect(outputs, hasLength(3));
34 expect(outputs[YAML_DOCUMENT], isNotNull);
35 expect(outputs[YAML_ERRORS], hasLength(0));
36 expect(outputs[YAML_LINE_INFO], isNotNull);
scheglov 2016/01/24 18:20:44 These expect(s) and in the test below are IMHO too
Brian Wilkerson 2016/01/24 23:14:44 True. More complete tests added.
37 }
38
39 test_perform_doesNotExist() {
40 _performParseTask(null);
41 expect(outputs, hasLength(3));
42 expect(outputs[YAML_DOCUMENT], isNotNull);
43 expect(outputs[YAML_ERRORS], hasLength(1));
44 expect(outputs[YAML_LINE_INFO], isNotNull);
45 }
46
47 void _performParseTask(String content) {
48 if (content == null) {
49 source = resourceProvider.getFile('/test.dart').createSource();
scheglov 2016/01/24 18:20:44 test.yaml ?
Brian Wilkerson 2016/01/24 23:14:44 Done
50 } else {
51 source = newSource('/test.dart', content);
52 }
53 computeResult(source, YAML_DOCUMENT, matcher: isParseYamlTask);
54 }
55 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/src/task/test_all.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698