Files
MarkZ 80586c8596 [reload_test] Porting VM hot reload tests related to member/field initialization to the hot reload suite.
These aren't fully inclusive, but they're good enough litmus tests.

Change-Id: I4954ac6cb43ea3bdf704c67c5bd70bf305756f55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380286
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2024-08-20 17:50:56 +00:00

31 lines
769 B
Dart

// Copyright (c) 2024, 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 'package:expect/expect.dart';
import 'package:reload_test/reload_test_utils.dart';
// Adapted from:
// https://github.com/dart-lang/sdk/blob/36c0788137d55c6c77f4b9a8be12e557bc764b1c/runtime/vm/isolate_reload_test.cc#L532
class Foo {
var x;
var y;
var z;
}
Future<void> main() async {
Expect.isNotNull(Foo());
Expect.equals(0, hotReloadGeneration);
await hotReload();
Expect.isNotNull(Foo());
Expect.equals(1, hotReloadGeneration);
await hotReload();
Expect.isNotNull(Foo());
Expect.equals(2, hotReloadGeneration);
}