blob: d056b31903b1e9030aedfc93e66de6b008336d2a [file] [log] [blame]
// Copyright (c) 2020, 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.
// Verify deferred library status is per-isolate, not per-isolate-group.
// VMOptions=--enable_isolate_groups --experimental_enable_isolate_groups_jit
import 'dart:async';
import 'dart:isolate';
import 'package:expect/expect.dart';
import "splay_test.dart" deferred as splay;
worker(SendPort sendPort) {
Expect.throws(() => splay.main(),
(e) => e.toString() == "Deferred library splay was not loaded.");
main() async {
await splay.loadLibrary();
final receivePort = ReceivePort();
Isolate.spawn(worker, receivePort.sendPort);
Expect.isTrue(await receivePort.first);