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

Side by Side Diff: tests/isolate/scenarios/short_package/short_package_test.dart

Issue 1822863002: - Properly return null if an unknown package is resolved. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address review comments. Created 4 years, 9 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
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 // PackageRoot=none
6
7 import 'dart:io';
8 import 'dart:isolate';
9
10 import "package:flu";
11
12 var PACKAGE_FLU = "package:flu";
13 var FLU_TEXT = "flu.text";
14
15 testShortResolution(package_uri) async {
16 var fluPackage = await Isolate.resolvePackageUri(Uri.parse(package_uri));
17 print("Resolved $package_uri to $fluPackage");
18 var fluText = fluPackage.resolve(FLU_TEXT);
19 print("Resolved $FLU_TEXT from $package_uri to $fluText");
20 var fluFile = new File.fromUri(fluText);
21 var fluString = await fluFile.readAsString();
22 if (fluString != "Bar") {
23 throw "Contents of $FLU_TEXT not matching.\n"
24 "Got: $fluString\n"
25 "Expected: Bar";
26 }
27 }
28
29 main([args, port]) async {
30 if (Flu.value != "Flu") {
31 throw "Import of wrong Flu package.";
32 }
33 await testShortResolution(PACKAGE_FLU);
34 await testShortResolution(PACKAGE_FLU + "/");
35 await testShortResolution(PACKAGE_FLU + "/abc.def");
36 print("SUCCESS");
37 }
OLDNEW
« runtime/bin/builtin.dart ('K') | « tests/isolate/scenarios/short_package/flu_package/flu.text ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698