[cfe] Add regression test for issue 42661
The issue has already been fixed in
https://dart-review.googlesource.com/c/sdk/+/152151
Closes #42661
Change-Id: I28e482924b17d09bd7c4fa8cd0948c267487b690
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154680
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
diff --git a/pkg/front_end/test/language_versioning/data/issue42661a/.dart_tool/package_config.json b/pkg/front_end/test/language_versioning/data/issue42661a/.dart_tool/package_config.json
new file mode 100644
index 0000000..0286844
--- /dev/null
+++ b/pkg/front_end/test/language_versioning/data/issue42661a/.dart_tool/package_config.json
@@ -0,0 +1,10 @@
+{
+ "configVersion": 2,
+ "packages": [
+ {
+ "name": "pack",
+ "rootUri": "../pack/lib/",
+ "languageVersion": "2.7"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/pkg/front_end/test/language_versioning/data/issue42661a/main.dart b/pkg/front_end/test/language_versioning/data/issue42661a/main.dart
new file mode 100644
index 0000000..06c234a
--- /dev/null
+++ b/pkg/front_end/test/language_versioning/data/issue42661a/main.dart
@@ -0,0 +1,3 @@
+/*library: languageVersion=2.8*/
+
+import 'pack/web/pack.dart';
diff --git a/pkg/front_end/test/language_versioning/data/issue42661a/pack/lib/src/part.dart b/pkg/front_end/test/language_versioning/data/issue42661a/pack/lib/src/part.dart
new file mode 100644
index 0000000..835902f
--- /dev/null
+++ b/pkg/front_end/test/language_versioning/data/issue42661a/pack/lib/src/part.dart
@@ -0,0 +1 @@
+part of pack;
diff --git a/pkg/front_end/test/language_versioning/data/issue42661a/pack/web/pack.dart b/pkg/front_end/test/language_versioning/data/issue42661a/pack/web/pack.dart
new file mode 100644
index 0000000..68e26be
--- /dev/null
+++ b/pkg/front_end/test/language_versioning/data/issue42661a/pack/web/pack.dart
@@ -0,0 +1,4 @@
+/*library: languageVersion=2.8*/
+library pack;
+
+part /*error: errors=LanguageVersionMismatchInPart*/ 'package:pack/src/part.dart';
diff --git a/pkg/front_end/test/language_versioning/data/issue42661b/.dart_tool/package_config.json b/pkg/front_end/test/language_versioning/data/issue42661b/.dart_tool/package_config.json
new file mode 100644
index 0000000..00f6b8c
--- /dev/null
+++ b/pkg/front_end/test/language_versioning/data/issue42661b/.dart_tool/package_config.json
@@ -0,0 +1,11 @@
+{
+ "configVersion": 2,
+ "packages": [
+ {
+ "name": "pack",
+ "rootUri": "../",
+ "packageUri": "lib/",
+ "languageVersion": "2.7"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/pkg/front_end/test/language_versioning/data/issue42661b/lib/src/part.dart b/pkg/front_end/test/language_versioning/data/issue42661b/lib/src/part.dart
new file mode 100644
index 0000000..835902f
--- /dev/null
+++ b/pkg/front_end/test/language_versioning/data/issue42661b/lib/src/part.dart
@@ -0,0 +1 @@
+part of pack;
diff --git a/pkg/front_end/test/language_versioning/data/issue42661b/main.dart b/pkg/front_end/test/language_versioning/data/issue42661b/main.dart
new file mode 100644
index 0000000..bd8fb96
--- /dev/null
+++ b/pkg/front_end/test/language_versioning/data/issue42661b/main.dart
@@ -0,0 +1,6 @@
+/*library:
+ languageVersion=2.7,
+ packageUri=package:pack
+*/
+
+import 'web/pack.dart';
diff --git a/pkg/front_end/test/language_versioning/data/issue42661b/web/pack.dart b/pkg/front_end/test/language_versioning/data/issue42661b/web/pack.dart
new file mode 100644
index 0000000..217ed77
--- /dev/null
+++ b/pkg/front_end/test/language_versioning/data/issue42661b/web/pack.dart
@@ -0,0 +1,7 @@
+/*library:
+ languageVersion=2.7,
+ packageUri=package:pack
+*/
+library pack;
+
+part 'package:pack/src/part.dart';
diff --git a/pkg/front_end/test/spell_checking_list_tests.txt b/pkg/front_end/test/spell_checking_list_tests.txt
index fae15ac..f0572dd 100644
--- a/pkg/front_end/test/spell_checking_list_tests.txt
+++ b/pkg/front_end/test/spell_checking_list_tests.txt
@@ -413,6 +413,7 @@
oracle
outbound
overlay
+pack
party
pause
paused