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

Unified Diff: pkg/analyzer_cli/test/sdk_ext_test.dart

Issue 1459683003: `analyzer_cli` move to SDK. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: master merge Created 5 years, 1 month 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/analyzer_cli/test/reporter_test.dart ('k') | pkg/analyzer_cli/test/strong_mode_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer_cli/test/sdk_ext_test.dart
diff --git a/pkg/analyzer_cli/test/sdk_ext_test.dart b/pkg/analyzer_cli/test/sdk_ext_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..1e716ffb72a492f019f86b1dbb09411c414d25c7
--- /dev/null
+++ b/pkg/analyzer_cli/test/sdk_ext_test.dart
@@ -0,0 +1,55 @@
+// Copyright (c) 2015, 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.
+
+@TestOn("vm")
+
+/// Test that sdk extensions are properly detected in various scenarios.
+library analyzer_cli.test.sdk_ext;
+
+import 'dart:io';
+
+import 'package:analyzer_cli/src/driver.dart' show Driver, errorSink, outSink;
+import 'package:path/path.dart' as path;
+import 'package:test/test.dart';
+
+import 'utils.dart';
+
+main() {
+ group('Sdk extensions', () {
+ StringSink savedOutSink, savedErrorSink;
+ int savedExitCode;
+ Directory savedCurrentDirectory;
+ setUp(() {
+ savedOutSink = outSink;
+ savedErrorSink = errorSink;
+ savedExitCode = exitCode;
+ outSink = new StringBuffer();
+ errorSink = new StringBuffer();
+ savedCurrentDirectory = Directory.current;
+ });
+ tearDown(() {
+ outSink = savedOutSink;
+ errorSink = savedErrorSink;
+ exitCode = savedExitCode;
+ Directory.current = savedCurrentDirectory;
+ });
+
+ test('--packages option supplied', () async {
+ var testDir = path.join(testDirectory, 'data', 'no_packages_file');
+ Directory.current = new Directory(testDir);
+ var packagesPath = path.join('..', 'packages_file', '.packages');
+ new Driver().start(['--packages', packagesPath, 'sdk_ext_user.dart']);
+
+ expect(exitCode, 0);
+ });
+
+ test('.packages file present', () async {
+ var testDir = path.join(testDirectory, 'data', 'packages_file');
+ Directory.current = new Directory(testDir);
+ new Driver().start(['sdk_ext_user.dart']);
+
+ expect(exitCode, 0);
+ });
+ });
+}
« no previous file with comments | « pkg/analyzer_cli/test/reporter_test.dart ('k') | pkg/analyzer_cli/test/strong_mode_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698