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

Side by Side Diff: pkg/analysis_server/test/integration/analysis/lint_test.dart

Issue 1398033004: One extension manager (to bind them all). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Unstage pubspec. Created 5 years, 2 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
OLDNEW
(Empty)
1 // Copyright (c) 2014, 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.integration.analysis.lint;
6
7 import 'package:analysis_server/plugin/protocol/protocol.dart';
8 import 'package:test_reflective_loader/test_reflective_loader.dart';
9 import 'package:unittest/unittest.dart';
10
11 import '../../utils.dart';
12 import '../integration_tests.dart';
13
14 main() {
15 initializeTestEnvironment();
16 defineReflectiveTests(LintIntegrationTest);
17 }
18
19 @reflectiveTest
20 class LintIntegrationTest extends AbstractAnalysisServerIntegrationTest {
21 test_no_lints_when_not_specified() async {
22 String source = sourcePath('test.dart');
23 writeFile(
24 source,
25 '''
26 class abc { // lint: not CamelCase (should get ignored though)
27 }''');
28 standardAnalysisSetup();
29
30 await analysisFinished;
31 expect(currentAnalysisErrors[source], isList);
32 // Should be empty without .analysis_options.
33 List<AnalysisError> errors = currentAnalysisErrors[source];
34 expect(errors, hasLength(0));
35 }
36
37 test_simple_lint() async {
38 writeFile(
39 sourcePath('.analysis_options'),
40 '''
41 linter:
42 rules:
43 - camel_case_types
44 ''');
45
46 String source = sourcePath('test.dart');
47 writeFile(
48 source,
49 '''
50 class a { // lint: not CamelCase
51 }''');
52
53 standardAnalysisSetup();
54
55 await analysisFinished;
56
57 expect(currentAnalysisErrors[source], isList);
58 List<AnalysisError> errors = currentAnalysisErrors[source];
59 expect(errors, hasLength(1));
60 AnalysisError error = errors[0];
61 expect(error.location.file, source);
62 expect(error.severity, AnalysisErrorSeverity.INFO);
63 expect(error.type, AnalysisErrorType.LINT);
64 }
65 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/pubspec.yaml ('k') | pkg/analysis_server/test/integration/analysis/test_all.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698