mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 16:41:07 +00:00
![Alexander Aprelev](/assets/img/avatar_default.png)
Fixes https://github.com/dart-lang/sdk/issues/46294 TEST=reg_exp_receive_port_test.dart Change-Id: Ic9ecde42224d44035ecb60347e11aae0bd92cd09 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202861 Commit-Queue: Alexander Aprelev <aam@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com>
27 lines
738 B
Dart
27 lines
738 B
Dart
// Copyright (c) 2014, 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.
|
|
//
|
|
// Checks that you can send and receive regex in a message.
|
|
|
|
import "dart:async";
|
|
import "dart:isolate";
|
|
|
|
import "package:async_helper/async_helper.dart";
|
|
import "package:expect/expect.dart";
|
|
|
|
main(args) async {
|
|
asyncStart();
|
|
final rp = ReceivePort();
|
|
final r = RegExp('b');
|
|
Expect.equals(r.firstMatch('bb')!.start, 0);
|
|
rp.sendPort.send(r);
|
|
|
|
final si = StreamIterator(rp);
|
|
await si.moveNext();
|
|
final x = si.current as RegExp;
|
|
Expect.equals(x.firstMatch('bb')!.start, 0);
|
|
rp.close();
|
|
asyncEnd();
|
|
}
|