OLD | NEW |
| (Empty) |
1 // Copyright (c) 2015, the Dartino 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.md file. | |
4 | |
5 library fletchc.compiler_api_test; | |
6 | |
7 import 'package:fletchc/compiler.dart' show | |
8 FletchCompiler; | |
9 | |
10 import 'package:expect/expect.dart' show | |
11 Expect; | |
12 | |
13 main(List<String> arguments) { | |
14 var compiler = new FletchCompiler(); | |
15 Expect.throws(compiler.run, (e) => e is StateError); | |
16 | |
17 Expect.throws( | |
18 () => new FletchCompiler(packageConfig: 0), | |
19 (e) => e is ArgumentError && '$e'.contains("packageConfig")); | |
20 | |
21 Expect.throws( | |
22 () => new FletchCompiler(libraryRoot: 0), | |
23 (e) => e is ArgumentError && '$e'.contains("libraryRoot")); | |
24 | |
25 Expect.throws( | |
26 () => new FletchCompiler(libraryRoot: '/dev/null'), | |
27 (e) => e is ArgumentError && '$e'.contains("Dart SDK library not found")); | |
28 | |
29 Expect.throws( | |
30 () => new FletchCompiler(script: 0), | |
31 (e) => e is ArgumentError && '$e'.contains("script")); | |
32 | |
33 new FletchCompiler(script: "lib/system/system.dart").run(); | |
34 | |
35 new FletchCompiler(script: Uri.parse("lib/system/system.dart")).run(); | |
36 | |
37 new FletchCompiler( | |
38 script: Uri.base.resolve("lib/system/system.dart")).run(); | |
39 | |
40 new FletchCompiler().run("lib/system/system.dart"); | |
41 | |
42 new FletchCompiler().run(Uri.parse("lib/system/system.dart")); | |
43 | |
44 new FletchCompiler().run(Uri.base.resolve("lib/system/system.dart")); | |
45 } | |
OLD | NEW |