mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 01:21:07 +00:00
b7909e132a
The existing lib/isolate/stacktrace_message_test was failing and also incorrectly written due to "!" in front of the expected stringification of the stacktrace. Issue https://github.com/dart-lang/sdk/issues/46623 TEST=vm/dart{,_2}/isolates/fast_object_copy2_test, lib{,_2}/isolate/stacktrace_message_test Change-Id: I169d8fd7a7c3cb3b8c57e00287565e3a5c622acf Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216041 Reviewed-by: Alexander Aprelev <aam@google.com> Commit-Queue: Martin Kustermann <kustermann@google.com>
29 lines
795 B
Dart
29 lines
795 B
Dart
// Copyright (c) 2013, 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.
|
|
|
|
import 'dart:isolate';
|
|
|
|
import "package:expect/expect.dart";
|
|
|
|
// Test that StackTrace objects can be sent between isolates spawned from
|
|
// the same isolate using Isolate.spawn.
|
|
|
|
void main() async {
|
|
final reply = ReceivePort();
|
|
Isolate.spawn(runTest, reply.sendPort);
|
|
final pair = await reply.first;
|
|
final stack = pair[0] as StackTrace;
|
|
final stackString = pair[1] as String;
|
|
Expect.isNotNull(stack);
|
|
Expect.equals(stackString, "$stack");
|
|
}
|
|
|
|
runTest(SendPort sendport) {
|
|
try {
|
|
throw 'sorry';
|
|
} catch (e, stack) {
|
|
sendport.send([stack, "$stack"]);
|
|
}
|
|
}
|