2012-02-15 20:00:55 +00:00
|
|
|
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
|
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
// Negative test to make sure that we are reaching all assertions.
|
2012-02-28 21:53:53 +00:00
|
|
|
// Note: the following comment is used by test.dart to additionally compile the
|
|
|
|
// other isolate's code.
|
2012-08-03 07:24:29 +00:00
|
|
|
// OtherScripts=spawn_uri_child_isolate.dart
|
2012-11-01 23:09:47 +00:00
|
|
|
library spawn_tests;
|
|
|
|
import 'dart:isolate';
|
2013-09-24 12:04:49 +00:00
|
|
|
import 'package:unittest/unittest.dart';
|
|
|
|
|
|
|
|
/* Dummy import so multi-test copies the file.
|
|
|
|
import 'spawn_uri_child_isolate.dart';
|
|
|
|
*/
|
2012-02-15 20:00:55 +00:00
|
|
|
|
|
|
|
main() {
|
2012-04-25 22:31:04 +00:00
|
|
|
test('isolate fromUri - negative test', () {
|
2012-02-15 20:00:55 +00:00
|
|
|
ReceivePort port = new ReceivePort();
|
2014-03-31 18:33:18 +00:00
|
|
|
port.first.then(expectAsync((msg) {
|
2013-09-24 12:04:49 +00:00
|
|
|
String expectedMessage = 're: hi';
|
|
|
|
// Should be hi, not hello.
|
|
|
|
expectedMessage = 're: hello'; /// 01: runtime error
|
|
|
|
expect(msg, equals(expectedMessage));
|
2012-04-25 22:31:04 +00:00
|
|
|
}));
|
2012-02-15 20:00:55 +00:00
|
|
|
|
2013-10-25 19:23:00 +00:00
|
|
|
Isolate.spawnUri(Uri.parse('spawn_uri_child_isolate.dart'),
|
|
|
|
['hi'], port.sendPort);
|
2012-02-15 20:00:55 +00:00
|
|
|
});
|
|
|
|
}
|