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