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 "dart:io"; |
| 6 import "dart:isolate"; |
| 7 import "package:expect/expect.dart"; |
| 8 |
| 9 main() async { |
| 10 var pkgRoot = Uri.parse("file:///no/such/directory/"); |
| 11 var pkgConfig = Uri.parse("file:///no/such/.packages"); |
| 12 try { |
| 13 var i = await Isolate.spawnUri(Platform.script, [], null, |
| 14 packageRoot: pkgRoot, packageConfig: pkgConfig); |
| 15 } catch (e) { |
| 16 print(e); |
| 17 Expect.isTrue(e is ArgumentError); |
| 18 } |
| 19 try { |
| 20 var i = await Isolate.spawnUri(Platform.script, [], null, |
| 21 packageRoot: pkgRoot, automaticPackageResolution: true); |
| 22 } catch (e) { |
| 23 print(e); |
| 24 Expect.isTrue(e is ArgumentError); |
| 25 } |
| 26 try { |
| 27 var i = await Isolate.spawnUri(Platform.script, [], null, |
| 28 packageConfig: pkgConfig, automaticPackageResolution: true); |
| 29 } catch (e) { |
| 30 print(e); |
| 31 Expect.isTrue(e is ArgumentError); |
| 32 } |
| 33 try { |
| 34 var i = await Isolate.spawnUri(Platform.script, [], null, |
| 35 packageRoot: pkgRoot, packageConfig: pkgConfig, |
| 36 automaticPackageResolution: true); |
| 37 } catch (e) { |
| 38 print(e); |
| 39 Expect.isTrue(e is ArgumentError); |
| 40 } |
| 41 } |
OLD | NEW |