-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Copy pathmain.1.dart
47 lines (37 loc) · 1.19 KB
/
main.1.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
// Copyright (c) 2025, 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/be2aabd91c67f7f331c49cb74e18fe5e469f04db/runtime/vm/isolate_reload_test.cc#L2371
enum Fruit {
Apple('Apple', 'A');
const Fruit(this.name, this.initial);
final String name;
final String initial;
}
var retained;
Future<void> main() async {
await hotReload();
Expect.equals('Fruit.Deleted enum value from Fruit', retained.toString());
}
/** DIFF **/
/*
// Adapted from:
// https://github.com/dart-lang/sdk/blob/be2aabd91c67f7f331c49cb74e18fe5e469f04db/runtime/vm/isolate_reload_test.cc#L2371
-enum Fruit { Apple, Banana }
+enum Fruit {
+ Apple('Apple', 'A');
+
+ const Fruit(this.name, this.initial);
+ final String name;
+ final String initial;
+}
var retained;
Future<void> main() async {
- retained = Fruit.Banana;
await hotReload();
Expect.equals('Fruit.Deleted enum value from Fruit', retained.toString());
}
*/