| 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);
|
| + });
|
| +}
|
|
|