Index: tests/isolate/simple_message_test.dart |
diff --git a/tests/isolate/isolate_negative_test.dart b/tests/isolate/simple_message_test.dart |
similarity index 55% |
rename from tests/isolate/isolate_negative_test.dart |
rename to tests/isolate/simple_message_test.dart |
index e40d23e995d9f303bea93fd33cc778f941628e8d..8338bd6eaa4d80a5c470dd9cef9350b87c6c0781 100644 |
--- a/tests/isolate/isolate_negative_test.dart |
+++ b/tests/isolate/simple_message_test.dart |
@@ -7,18 +7,20 @@ |
library IsolateNegativeTest; |
import "package:expect/expect.dart"; |
import 'dart:isolate'; |
-import '../../pkg/unittest/lib/unittest.dart'; |
+import "package:async_helper/async_helper.dart"; |
void entry(SendPort replyTo) { |
- replyTo.send("foo"); |
+ var message = "foo"; |
+ message = "bar"; /// 01: runtime error |
+ replyTo.send(message); |
} |
main() { |
- test("ensure isolate code is executed", () { |
- ReceivePort response = new ReceivePort(); |
- Isolate.spawn(entry, response.sendPort); |
- response.first.then(expectAsync1((message) { |
- expect("Expected fail", isTrue); // <=-------- Should fail here. |
- })); |
+ asyncStart(); |
+ ReceivePort response = new ReceivePort(); |
+ Isolate.spawn(entry, response.sendPort); |
+ response.first.then((message) { |
+ Expect.equals("foo", message); |
+ asyncEnd(); |
}); |
} |