Skip to content

Commit 5ec1002

Browse files
nshahanCommit Queue
authored andcommitted
[ddc] Port library show/hide hot reload tests
Change-Id: Iaa7ef742f1204c73e96738cdba774f1263b32797 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405061 Commit-Queue: Nicholas Shahan <[email protected]> Reviewed-by: Nate Biggs <[email protected]> Reviewed-by: Mark Zhou <[email protected]>
1 parent 1a48649 commit 5ec1002

File tree

16 files changed

+326
-0
lines changed

16 files changed

+326
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"expectedErrors": {
3+
"1": "Error: Method not found: 'importedFunc'."
4+
}
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
importedFunc() => 'a';
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
importedFunc() => 'a';
6+
7+
/** DIFF **/
8+
/*
9+
*/
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
importedFunc() => 'a';
6+
7+
/** DIFF **/
8+
/*
9+
*/
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
import 'package:expect/expect.dart';
6+
import 'package:reload_test/reload_test_utils.dart';
7+
8+
// Adapted from:
9+
// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1123
10+
11+
void helper() {}
12+
13+
Future<void> main() async {
14+
helper();
15+
await hotReload(expectRejection: true);
16+
helper();
17+
await hotReload();
18+
helper();
19+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
import 'package:expect/expect.dart';
6+
import 'package:reload_test/reload_test_utils.dart';
7+
8+
import 'lib1.dart' hide importedFunc;
9+
10+
// Adapted from:
11+
// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1123
12+
13+
void helper() {
14+
Expect.equals('a', importedFunc());
15+
}
16+
17+
Future<void> main() async {
18+
helper();
19+
await hotReload(expectRejection: true);
20+
helper();
21+
await hotReload();
22+
helper();
23+
}
24+
25+
/** DIFF **/
26+
/*
27+
@@ -5,10 +5,14 @@
28+
import 'package:expect/expect.dart';
29+
import 'package:reload_test/reload_test_utils.dart';
30+
31+
+import 'lib1.dart' hide importedFunc;
32+
+
33+
// Adapted from:
34+
// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1123
35+
36+
-void helper() {}
37+
+void helper() {
38+
+ Expect.equals('a', importedFunc());
39+
+}
40+
41+
Future<void> main() async {
42+
helper();
43+
*/
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
import 'package:expect/expect.dart';
6+
import 'package:reload_test/reload_test_utils.dart';
7+
8+
import 'lib1.dart';
9+
10+
// Adapted from:
11+
// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1123
12+
13+
void helper() {
14+
Expect.equals('a', importedFunc());
15+
}
16+
17+
Future<void> main() async {
18+
helper();
19+
await hotReload(expectRejection: true);
20+
helper();
21+
await hotReload();
22+
helper();
23+
}
24+
25+
/** DIFF **/
26+
/*
27+
@@ -5,7 +5,7 @@
28+
import 'package:expect/expect.dart';
29+
import 'package:reload_test/reload_test_utils.dart';
30+
31+
-import 'lib1.dart' hide importedFunc;
32+
+import 'lib1.dart';
33+
34+
// Adapted from:
35+
// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1123
36+
*/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"expectedErrors": {
3+
"1": "Error: Method not found: 'importedFunc'.",
4+
"2": "Error: Method not found: 'importedIntFunc'."
5+
}
6+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
// Adapted from:
6+
// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1153
7+
8+
importedFunc() => 'a';
9+
importedIntFunc() => 4;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
// Adapted from:
6+
// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1153
7+
8+
importedFunc() => 'a';
9+
importedIntFunc() => 4;
10+
11+
/** DIFF **/
12+
/*
13+
*/

0 commit comments

Comments
 (0)