OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library analyzer_cli.test.driver; | 5 library analyzer_cli.test.driver; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 | 9 |
10 import 'package:analyzer/error/error.dart'; | 10 import 'package:analyzer/error/error.dart'; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 group('options', () { | 59 group('options', () { |
60 test('todos', () async { | 60 test('todos', () async { |
61 await drive('data/file_with_todo.dart'); | 61 await drive('data/file_with_todo.dart'); |
62 expect(outSink.toString().contains('[info]'), isFalse); | 62 expect(outSink.toString().contains('[info]'), isFalse); |
63 }); | 63 }); |
64 }); | 64 }); |
65 | 65 |
66 group('exit codes', () { | 66 group('exit codes', () { |
67 test('fatal hints', () async { | 67 test('fatal hints', () async { |
68 await drive('data/file_with_hint.dart', args: ['--fatal-hints']); | 68 await drive('data/file_with_hint.dart', args: ['--fatal-hints']); |
69 expect(exitCode, 3); | 69 expect(exitCode, 1); |
70 }); | 70 }); |
71 | 71 |
72 test('not fatal hints', () async { | 72 test('not fatal hints', () async { |
73 await drive('data/file_with_hint.dart'); | 73 await drive('data/file_with_hint.dart'); |
74 expect(exitCode, 0); | 74 expect(exitCode, 0); |
75 }); | 75 }); |
76 | 76 |
77 test('fatal errors', () async { | 77 test('fatal errors', () async { |
78 await drive('data/file_with_error.dart'); | 78 await drive('data/file_with_error.dart'); |
79 expect(exitCode, 3); | 79 expect(exitCode, 3); |
80 }); | 80 }); |
81 | 81 |
82 test('not fatal warnings', () async { | 82 test('not fatal warnings', () async { |
83 await drive('data/file_with_warning.dart'); | 83 await drive('data/file_with_warning.dart'); |
84 expect(exitCode, 0); | 84 expect(exitCode, 0); |
85 }); | 85 }); |
86 | 86 |
87 test('fatal warnings', () async { | 87 test('fatal warnings', () async { |
88 await drive('data/file_with_warning.dart', args: ['--fatal-warnings']); | 88 await drive('data/file_with_warning.dart', args: ['--fatal-warnings']); |
89 expect(exitCode, 3); | 89 expect(exitCode, 2); |
90 }); | 90 }); |
91 | 91 |
92 test('not parse enableAssertInitializer', () async { | 92 test('not parse enableAssertInitializer', () async { |
93 await drive('data/file_with_assert_initializers.dart', | 93 await drive('data/file_with_assert_initializers.dart', |
94 args: ['--enable-assert-initializers']); | 94 args: ['--enable-assert-initializers']); |
95 expect(exitCode, 0); | 95 expect(exitCode, 0); |
96 }); | 96 }); |
97 | 97 |
98 test('missing options file', () async { | 98 test('missing options file', () async { |
99 await drive('data/test_file.dart', options: 'data/NO_OPTIONS_HERE'); | 99 await drive('data/test_file.dart', options: 'data/NO_OPTIONS_HERE'); |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 | 612 |
613 class TestSource implements Source { | 613 class TestSource implements Source { |
614 TestSource(); | 614 TestSource(); |
615 | 615 |
616 @override | 616 @override |
617 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 617 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
618 } | 618 } |
619 | 619 |
620 /// Normalize text with bullets. | 620 /// Normalize text with bullets. |
621 String _bulletToDash(item) => '$item'.replaceAll('•', '-'); | 621 String _bulletToDash(item) => '$item'.replaceAll('•', '-'); |
OLD | NEW |