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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/integration/analysis/lint_test.dart
diff --git a/pkg/analysis_server/test/integration/analysis/lint_test.dart b/pkg/analysis_server/test/integration/analysis/lint_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..e75120c9618f4311cf2316cac1bf39ddfda98e3a
--- /dev/null
+++ b/pkg/analysis_server/test/integration/analysis/lint_test.dart
@@ -0,0 +1,65 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library test.integration.analysis.lint;
+
+import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+import 'package:unittest/unittest.dart';
+
+import '../../utils.dart';
+import '../integration_tests.dart';
+
+main() {
+ initializeTestEnvironment();
+ defineReflectiveTests(LintIntegrationTest);
+}
+
+@reflectiveTest
+class LintIntegrationTest extends AbstractAnalysisServerIntegrationTest {
+ test_no_lints_when_not_specified() async {
+ String source = sourcePath('test.dart');
+ writeFile(
+ source,
+ '''
+class abc { // lint: not CamelCase (should get ignored though)
+}''');
+ standardAnalysisSetup();
+
+ await analysisFinished;
+ expect(currentAnalysisErrors[source], isList);
+ // Should be empty without .analysis_options.
+ List<AnalysisError> errors = currentAnalysisErrors[source];
+ expect(errors, hasLength(0));
+ }
+
+ test_simple_lint() async {
+ writeFile(
+ sourcePath('.analysis_options'),
+ '''
+linter:
+ rules:
+ - camel_case_types
+''');
+
+ String source = sourcePath('test.dart');
+ writeFile(
+ source,
+ '''
+class a { // lint: not CamelCase
+}''');
+
+ standardAnalysisSetup();
+
+ await analysisFinished;
+
+ expect(currentAnalysisErrors[source], isList);
+ List<AnalysisError> errors = currentAnalysisErrors[source];
+ expect(errors, hasLength(1));
+ AnalysisError error = errors[0];
+ expect(error.location.file, source);
+ expect(error.severity, AnalysisErrorSeverity.INFO);
+ expect(error.type, AnalysisErrorType.LINT);
+ }
+}
« 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