diff --git a/tests/hot_reload/library_hide/config.json b/tests/hot_reload/library_hide/config.json new file mode 100644 index 00000000000..9e0a859a25c --- /dev/null +++ b/tests/hot_reload/library_hide/config.json @@ -0,0 +1,5 @@ +{ + "expectedErrors": { + "1": "Error: Method not found: 'importedFunc'." + } +} \ No newline at end of file diff --git a/tests/hot_reload/library_hide/lib1.0.dart b/tests/hot_reload/library_hide/lib1.0.dart new file mode 100644 index 00000000000..1dda1494abe --- /dev/null +++ b/tests/hot_reload/library_hide/lib1.0.dart @@ -0,0 +1,5 @@ +// 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. + +importedFunc() => 'a'; diff --git a/tests/hot_reload/library_hide/lib1.1.reject.dart b/tests/hot_reload/library_hide/lib1.1.reject.dart new file mode 100644 index 00000000000..296c51d279f --- /dev/null +++ b/tests/hot_reload/library_hide/lib1.1.reject.dart @@ -0,0 +1,9 @@ +// 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. + +importedFunc() => 'a'; + +/** DIFF **/ +/* +*/ diff --git a/tests/hot_reload/library_hide/lib1.2.dart b/tests/hot_reload/library_hide/lib1.2.dart new file mode 100644 index 00000000000..296c51d279f --- /dev/null +++ b/tests/hot_reload/library_hide/lib1.2.dart @@ -0,0 +1,9 @@ +// 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. + +importedFunc() => 'a'; + +/** DIFF **/ +/* +*/ diff --git a/tests/hot_reload/library_hide/main.0.dart b/tests/hot_reload/library_hide/main.0.dart new file mode 100644 index 00000000000..f5436abbf69 --- /dev/null +++ b/tests/hot_reload/library_hide/main.0.dart @@ -0,0 +1,19 @@ +// 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/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1123 + +void helper() {} + +Future main() async { + helper(); + await hotReload(expectRejection: true); + helper(); + await hotReload(); + helper(); +} diff --git a/tests/hot_reload/library_hide/main.1.reject.dart b/tests/hot_reload/library_hide/main.1.reject.dart new file mode 100644 index 00000000000..2c303a02dc4 --- /dev/null +++ b/tests/hot_reload/library_hide/main.1.reject.dart @@ -0,0 +1,43 @@ +// 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'; + +import 'lib1.dart' hide importedFunc; + +// Adapted from: +// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1123 + +void helper() { + Expect.equals('a', importedFunc()); +} + +Future main() async { + helper(); + await hotReload(expectRejection: true); + helper(); + await hotReload(); + helper(); +} + +/** DIFF **/ +/* +@@ -5,10 +5,14 @@ + import 'package:expect/expect.dart'; + import 'package:reload_test/reload_test_utils.dart'; + ++import 'lib1.dart' hide importedFunc; ++ + // Adapted from: + // https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1123 + +-void helper() {} ++void helper() { ++ Expect.equals('a', importedFunc()); ++} + + Future main() async { + helper(); +*/ diff --git a/tests/hot_reload/library_hide/main.2.dart b/tests/hot_reload/library_hide/main.2.dart new file mode 100644 index 00000000000..9f53ab5c917 --- /dev/null +++ b/tests/hot_reload/library_hide/main.2.dart @@ -0,0 +1,36 @@ +// 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'; + +import 'lib1.dart'; + +// Adapted from: +// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1123 + +void helper() { + Expect.equals('a', importedFunc()); +} + +Future main() async { + helper(); + await hotReload(expectRejection: true); + helper(); + await hotReload(); + helper(); +} + +/** DIFF **/ +/* +@@ -5,7 +5,7 @@ + import 'package:expect/expect.dart'; + import 'package:reload_test/reload_test_utils.dart'; + +-import 'lib1.dart' hide importedFunc; ++import 'lib1.dart'; + + // Adapted from: + // https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1123 +*/ diff --git a/tests/hot_reload/library_show/config.json b/tests/hot_reload/library_show/config.json new file mode 100644 index 00000000000..67abde786cc --- /dev/null +++ b/tests/hot_reload/library_show/config.json @@ -0,0 +1,6 @@ +{ + "expectedErrors": { + "1": "Error: Method not found: 'importedFunc'.", + "2": "Error: Method not found: 'importedIntFunc'." + } +} \ No newline at end of file diff --git a/tests/hot_reload/library_show/lib1.0.dart b/tests/hot_reload/library_show/lib1.0.dart new file mode 100644 index 00000000000..a6f7b8c5200 --- /dev/null +++ b/tests/hot_reload/library_show/lib1.0.dart @@ -0,0 +1,9 @@ +// 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. + +// Adapted from: +// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1153 + +importedFunc() => 'a'; +importedIntFunc() => 4; diff --git a/tests/hot_reload/library_show/lib1.1.reject.dart b/tests/hot_reload/library_show/lib1.1.reject.dart new file mode 100644 index 00000000000..946c1dfdb54 --- /dev/null +++ b/tests/hot_reload/library_show/lib1.1.reject.dart @@ -0,0 +1,13 @@ +// 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. + +// Adapted from: +// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1153 + +importedFunc() => 'a'; +importedIntFunc() => 4; + +/** DIFF **/ +/* +*/ diff --git a/tests/hot_reload/library_show/lib1.2.reject.dart b/tests/hot_reload/library_show/lib1.2.reject.dart new file mode 100644 index 00000000000..946c1dfdb54 --- /dev/null +++ b/tests/hot_reload/library_show/lib1.2.reject.dart @@ -0,0 +1,13 @@ +// 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. + +// Adapted from: +// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1153 + +importedFunc() => 'a'; +importedIntFunc() => 4; + +/** DIFF **/ +/* +*/ diff --git a/tests/hot_reload/library_show/lib1.3.dart b/tests/hot_reload/library_show/lib1.3.dart new file mode 100644 index 00000000000..946c1dfdb54 --- /dev/null +++ b/tests/hot_reload/library_show/lib1.3.dart @@ -0,0 +1,13 @@ +// 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. + +// Adapted from: +// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1153 + +importedFunc() => 'a'; +importedIntFunc() => 4; + +/** DIFF **/ +/* +*/ diff --git a/tests/hot_reload/library_show/main.0.dart b/tests/hot_reload/library_show/main.0.dart new file mode 100644 index 00000000000..df7512d934b --- /dev/null +++ b/tests/hot_reload/library_show/main.0.dart @@ -0,0 +1,25 @@ +// 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'; + +import 'lib1.dart' show importedIntFunc; + +// Adapted from: +// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1153 + +void helper() { + Expect.equals(4, importedIntFunc()); +} + +Future main() async { + helper(); + await hotReload(expectRejection: true); + helper(); + await hotReload(expectRejection: true); + helper(); + await hotReload(); + helper(); +} diff --git a/tests/hot_reload/library_show/main.1.reject.dart b/tests/hot_reload/library_show/main.1.reject.dart new file mode 100644 index 00000000000..218db2a9e96 --- /dev/null +++ b/tests/hot_reload/library_show/main.1.reject.dart @@ -0,0 +1,38 @@ +// 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'; + +import 'lib1.dart' show importedIntFunc; + +// Adapted from: +// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1153 + +void helper() { + Expect.equals(4, importedFunc()); +} + +Future main() async { + helper(); + await hotReload(expectRejection: true); + helper(); + await hotReload(expectRejection: true); + helper(); + await hotReload(); + helper(); +} + +/** DIFF **/ +/* +@@ -11,7 +11,7 @@ + // https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1153 + + void helper() { +- Expect.equals(4, importedIntFunc()); ++ Expect.equals(4, importedFunc()); + } + + Future main() async { +*/ diff --git a/tests/hot_reload/library_show/main.2.reject.dart b/tests/hot_reload/library_show/main.2.reject.dart new file mode 100644 index 00000000000..f6d9781e731 --- /dev/null +++ b/tests/hot_reload/library_show/main.2.reject.dart @@ -0,0 +1,45 @@ +// 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'; + +import 'lib1.dart' show importedFunc; + +// Adapted from: +// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1153 + +void helper() { + Expect.equals(4, importedIntFunc()); +} + +Future main() async { + helper(); + await hotReload(expectRejection: true); + helper(); + await hotReload(expectRejection: true); + helper(); + await hotReload(); + helper(); +} + +/** DIFF **/ +/* +@@ -5,13 +5,13 @@ + import 'package:expect/expect.dart'; + import 'package:reload_test/reload_test_utils.dart'; + +-import 'lib1.dart' show importedIntFunc; ++import 'lib1.dart' show importedFunc; + + // Adapted from: + // https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1153 + + void helper() { +- Expect.equals(4, importedFunc()); ++ Expect.equals(4, importedIntFunc()); + } + + Future main() async { +*/ diff --git a/tests/hot_reload/library_show/main.3.dart b/tests/hot_reload/library_show/main.3.dart new file mode 100644 index 00000000000..dc5a2e03331 --- /dev/null +++ b/tests/hot_reload/library_show/main.3.dart @@ -0,0 +1,38 @@ +// 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'; + +import 'lib1.dart' show importedFunc; + +// Adapted from: +// https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1153 + +void helper() { + Expect.equals('a', importedFunc()); +} + +Future main() async { + helper(); + await hotReload(expectRejection: true); + helper(); + await hotReload(expectRejection: true); + helper(); + await hotReload(); + helper(); +} + +/** DIFF **/ +/* +@@ -11,7 +11,7 @@ + // https://github.com/dart-lang/sdk/blob/9f465e5b6eab0dc3af96140189d4f0190e0ff925/runtime/vm/isolate_reload_test.cc#L1153 + + void helper() { +- Expect.equals(4, importedIntFunc()); ++ Expect.equals('a', importedFunc()); + } + + Future main() async { +*/