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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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"),
34 throwsFormatException);
35 });
36
37 test("with an invalid package URI", () {
38 expect(() => resolver.resolveUri("package:"), throwsFormatException);
39 });
40 });
41
42 test("packageUriFor with an invalid argument type", () {
43 expect(() => resolver.packageUriFor(12), throwsArgumentError);
44 });
45 }
OLDNEW
« 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