Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2016, 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 import 'package:test/test.dart'; | |
| 6 | |
| 7 import 'package:package_resolver/package_resolver.dart'; | |
| 8 | |
| 9 void main() { | |
| 10 var resolver; | |
| 11 setUp(() { | |
| 12 resolver = SyncPackageResolver.none; | |
| 13 }); | |
| 14 | |
| 15 test("exposes everything as null", () { | |
| 16 expect(resolver.packageConfigMap, isNull); | |
| 17 expect(resolver.packageConfigUri, isNull); | |
| 18 expect(resolver.packageRoot, isNull); | |
| 19 expect(resolver.processArgument, isNull); | |
| 20 expect(resolver.resolveUri("package:foo/bar.dart"), isNull); | |
| 21 expect(resolver.urlFor("foo"), isNull); | |
| 22 expect(resolver.urlFor("foo", "bar.dart"), isNull); | |
| 23 expect(resolver.packageUriFor("file:///foo/bar.dart"), isNull); | |
| 24 expect(resolver.packagePath("foo"), isNull); | |
| 25 }); | |
| 26 | |
| 27 group("resolveUri", () { | |
| 28 test("with an invalid argument type", () { | |
| 29 expect(() => resolver.resolveUri(12), throwsArgumentError); | |
| 30 }); | |
| 31 | |
| 32 test("with a non-package URI", () { | |
| 33 expect(() => resolver.resolveUri("file:///zip/zap"), throwsFormatException ); | |
|
Bob Nystrom
2016/07/21 18:00:32
Long line.
nweiz
2016/07/21 19:42:43
Done.
| |
| 34 }); | |
| 35 | |
| 36 test("with an invalid package URI", () { | |
| 37 expect(() => resolver.resolveUri("package:"), throwsFormatException); | |
| 38 }); | |
| 39 }); | |
| 40 | |
| 41 test("packageUriFor with an invalid argument type", () { | |
| 42 expect(() => resolver.packageUriFor(12), throwsArgumentError); | |
| 43 }); | |
| 44 } | |
| OLD | NEW |