-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Copy pathmain.3.dart
48 lines (38 loc) · 1.35 KB
/
main.3.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// 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';
var value = "after";
Future<void> main() async {
// Declare an unreferenced lazy static field.
Expect.equals(0, hotReloadGeneration);
await hotReload();
// The lazy static field changes value but remains unread.
Expect.equals(1, hotReloadGeneration);
await hotReload();
// The lazy static is now read and contains the updated value.
Expect.equals(2, hotReloadGeneration);
Expect.equals("before", value);
await hotReload();
// The lazy static is updated and read but retains the old value.
Expect.equals(3, hotReloadGeneration);
Expect.equals("before", value);
}
/** DIFF **/
/*
@@ -5,7 +5,7 @@
import 'package:expect/expect.dart';
import 'package:reload_test/reload_test_utils.dart';
-var value = "before";
+var value = "after";
Future<void> main() async {
// Declare an unreferenced lazy static field.
@@ -17,7 +17,6 @@
await hotReload();
// The lazy static is now read and contains the updated value.
- print(value);
Expect.equals(2, hotReloadGeneration);
Expect.equals("before", value);
await hotReload();
*/