| 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 /// Tests of 'package:fletchc/src/zone_helper.dart'. | 5 /// Tests of 'package:dartino_compiler/src/zone_helper.dart'. |
| 6 library fletch_tests.zone_helper_tests; | 6 library dartino_tests.zone_helper_tests; |
| 7 | 7 |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 | 9 |
| 10 import 'dart:isolate'; | 10 import 'dart:isolate'; |
| 11 | 11 |
| 12 import 'package:fletchc/src/zone_helper.dart'; | 12 import 'package:dartino_compiler/src/zone_helper.dart'; |
| 13 | 13 |
| 14 import 'package:expect/expect.dart'; | 14 import 'package:expect/expect.dart'; |
| 15 | 15 |
| 16 import 'dart:io' show | 16 import 'dart:io' show |
| 17 Platform; | 17 Platform; |
| 18 | 18 |
| 19 final Uri fileWithCompileTimeError = | 19 final Uri fileWithCompileTimeError = |
| 20 Uri.base.resolve("tests/fletch_tests/file_with_compile_time_error.dart"); | 20 Uri.base.resolve("tests/dartino_tests/file_with_compile_time_error.dart"); |
| 21 | 21 |
| 22 /// Test that runGuarded completes with an error when a synchronous error is | 22 /// Test that runGuarded completes with an error when a synchronous error is |
| 23 /// thrown. | 23 /// thrown. |
| 24 testEarlySyncError() { | 24 testEarlySyncError() { |
| 25 bool threw = false; | 25 bool threw = false; |
| 26 return runGuarded(() { | 26 return runGuarded(() { |
| 27 throw "Early error"; | 27 throw "Early error"; |
| 28 }, handleLateError: (e, s) { | 28 }, handleLateError: (e, s) { |
| 29 throw "Broken"; | 29 throw "Broken"; |
| 30 }).catchError((e) { | 30 }).catchError((e) { |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 testCompileTimeErrorHelper(null, () {}); | 185 testCompileTimeErrorHelper(null, () {}); |
| 186 } | 186 } |
| 187 | 187 |
| 188 testCompileTimeErrorHelper(SendPort port, void methodWithCompileTimeError()) { | 188 testCompileTimeErrorHelper(SendPort port, void methodWithCompileTimeError()) { |
| 189 return runGuarded(() { | 189 return runGuarded(() { |
| 190 methodWithCompileTimeError(); | 190 methodWithCompileTimeError(); |
| 191 }).catchError((e, s) { | 191 }).catchError((e, s) { |
| 192 port.send("Error in isolate: $e\nStack trace: $s"); | 192 port.send("Error in isolate: $e\nStack trace: $s"); |
| 193 }); | 193 }); |
| 194 } | 194 } |
| OLD | NEW |