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

Unified Diff: test/no_package_info_test.dart

Issue 2132443003: Add package implementation. (Closed) Base URL: git@github.com:dart-lang/package_resolver@master
Patch Set: Code review changes Created 4 years, 5 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 | « test/current_isolate_info_test.dart ('k') | test/package_config_info_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/no_package_info_test.dart
diff --git a/test/no_package_info_test.dart b/test/no_package_info_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..fddb0116be4b44343a90aa5d21fd329cebf5e105
--- /dev/null
+++ b/test/no_package_info_test.dart
@@ -0,0 +1,45 @@
+// Copyright (c) 2016, 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.
+
+import 'package:test/test.dart';
+
+import 'package:package_resolver/package_resolver.dart';
+
+void main() {
+ var resolver;
+ setUp(() {
+ resolver = SyncPackageResolver.none;
+ });
+
+ test("exposes everything as null", () {
+ expect(resolver.packageConfigMap, isNull);
+ expect(resolver.packageConfigUri, isNull);
+ expect(resolver.packageRoot, isNull);
+ expect(resolver.processArgument, isNull);
+ expect(resolver.resolveUri("package:foo/bar.dart"), isNull);
+ expect(resolver.urlFor("foo"), isNull);
+ expect(resolver.urlFor("foo", "bar.dart"), isNull);
+ expect(resolver.packageUriFor("file:///foo/bar.dart"), isNull);
+ expect(resolver.packagePath("foo"), isNull);
+ });
+
+ group("resolveUri", () {
+ test("with an invalid argument type", () {
+ expect(() => resolver.resolveUri(12), throwsArgumentError);
+ });
+
+ test("with a non-package URI", () {
+ expect(() => resolver.resolveUri("file:///zip/zap"),
+ throwsFormatException);
+ });
+
+ test("with an invalid package URI", () {
+ expect(() => resolver.resolveUri("package:"), throwsFormatException);
+ });
+ });
+
+ test("packageUriFor with an invalid argument type", () {
+ expect(() => resolver.packageUriFor(12), throwsArgumentError);
+ });
+}
« no previous file with comments | « test/current_isolate_info_test.dart ('k') | test/package_config_info_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698