forked from dart-lang/co19
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix tests according to the new understanding of the spec
- Loading branch information
Showing
12 changed files
with
148 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
LanguageFeatures/Parts-with-imports/scope_A03_t03_part1.dart
This file was deleted.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
LanguageFeatures/Parts-with-imports/scope_A03_t03_part2.dart
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// 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. | ||
|
||
/// @assertion Let P be a prefix scope containing all the import prefixes | ||
/// declared by the current file. The parent scope of P is I. | ||
/// ... | ||
/// - If an import is `deferred`, its Pname is a deferred scope which | ||
/// has an extra `loadLibrary` member added, as usual, and the import has an | ||
/// implicit `hide loadLibrary` modifier. | ||
/// | ||
/// @description Check that if an import is deferred an extra `loadLibrary` | ||
/// member is added and it is a runtime error to access any of its members | ||
/// before `loadLibrary()` completes successfully. Test the case when | ||
/// `loadLibrary()` is called from another part file. | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=enhanced-parts | ||
|
||
import '../../Utils/expect.dart'; | ||
part 'scope_A05_t02_part1.dart'; | ||
|
||
main() { | ||
testPart2(); | ||
} |
24 changes: 24 additions & 0 deletions
24
LanguageFeatures/Parts-with-imports/scope_A05_t02_part1.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// 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. | ||
|
||
/// @assertion Let P be a prefix scope containing all the import prefixes | ||
/// declared by the current file. The parent scope of P is I. | ||
/// ... | ||
/// - If an import is `deferred`, its Pname is a deferred scope which | ||
/// has an extra `loadLibrary` member added, as usual, and the import has an | ||
/// implicit `hide loadLibrary` modifier. | ||
/// | ||
/// @description Check that if an import is deferred an extra `loadLibrary` | ||
/// member is added and it is a runtime error to access any of its members | ||
/// before `loadLibrary()` completes successfully. Test the case when | ||
/// `loadLibrary()` is called from another part file. | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=enhanced-parts | ||
|
||
part of 'scope_A05_t02.dart'; | ||
|
||
import 'scope_lib1.dart' deferred as l1; | ||
|
||
part 'scope_A05_t02_part2.dart'; |
49 changes: 49 additions & 0 deletions
49
LanguageFeatures/Parts-with-imports/scope_A05_t02_part2.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// 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. | ||
|
||
/// @assertion Let P be a prefix scope containing all the import prefixes | ||
/// declared by the current file. The parent scope of P is I. | ||
/// ... | ||
/// - If an import is `deferred`, its Pname is a deferred scope which | ||
/// has an extra `loadLibrary` member added, as usual, and the import has an | ||
/// implicit `hide loadLibrary` modifier. | ||
/// | ||
/// @description Check that if an import is deferred an extra `loadLibrary` | ||
/// member is added and it is a runtime error to access any of its members | ||
/// before `loadLibrary()` completes successfully. Test the case when | ||
/// `loadLibrary()` is called from another part file. | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=enhanced-parts | ||
|
||
part of 'scope_A05_t02_part1.dart'; | ||
|
||
part 'scope_A05_t02_part2.dart'; | ||
|
||
testPart2() async { | ||
// From scope_lib1.dart | ||
Expect.throws(() {print(l1.libVar);}); | ||
Expect.throws(() {print(l1.libGetter);}); | ||
Expect.throws(() {l1.libSetter = "x";}); | ||
Expect.throws(() {print(l1.libFunc);}); | ||
Expect.throws(() {print(l1.LibClass.id);}); | ||
Expect.throws(() {print(l1.LibMixin.id);}); | ||
Expect.throws(() {print(l1.LibEnum.id);}); | ||
Expect.throws(() {print(l1.LibExt.id);}); | ||
Expect.throws(() {print(l1.LibET.id);}); | ||
|
||
await l1.loadLibrary(); | ||
|
||
Expect.equals("scope_lib1 libVar", l1.libVar); | ||
Expect.equals("scope_lib1 libGetter", l1.libGetter); | ||
l1.libSetter = "x"; | ||
Expect.equals("scope_lib1 libFunc", l1.libFunc); | ||
Expect.equals("scope_lib1 LibClass", l1.LibClass.id); | ||
Expect.equals("scope_lib1 LibMixin", l1.LibMixin.id); | ||
Expect.equals("scope_lib1 LibEnum", l1.LibEnum.id); | ||
Expect.equals("scope_lib1 LibExt", l1.LibExt.id); | ||
Expect.equals("scope_lib1 LibET", l1.LibET.id); | ||
|
||
await l1.loadLibrary(); // Not an error | ||
} |