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.
dart-lang#2559. Add applying augmentation library tests
- Loading branch information
Showing
19 changed files
with
377 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A01_t01.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,22 @@ | ||
// 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 It is a compile-time error if: | ||
/// - The library referenced in an `import augment` directive is not an | ||
/// augmentation and does not have a `library augment` directive. | ||
/// | ||
/// @description Check that it is a compile-time error if a library referenced | ||
/// in an `import augment` directive is not an does not have a `library augment` | ||
/// directive | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
import augment 'applying_augmentation_library_A01_t01_lib.dart'; | ||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
main() { | ||
} |
16 changes: 16 additions & 0 deletions
16
LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A01_t01_lib.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,16 @@ | ||
// 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 It is a compile-time error if: | ||
/// - The library referenced in an `import augment` directive is not an | ||
/// augmentation and does not have a `library augment` directive. | ||
/// | ||
/// @description Check that it is a compile-time error if a library referenced | ||
/// in an `import augment` directive is not an does not have a `library augment` | ||
/// directive | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
library applying_augmentation_library_A01_t01.dart; |
26 changes: 26 additions & 0 deletions
26
LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A01_t02.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,26 @@ | ||
// 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 It is a compile-time error if: | ||
/// - The library referenced in an `import augment` directive is not an | ||
/// augmentation and does not have a `library augment` directive. | ||
/// | ||
/// @description Check that it is a compile-time error if a library referenced | ||
/// in an `import augment` directive is not an does not have a `library augment` | ||
/// directive. Test the case when referenced library is part of the main library | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
library applying_augmentation_library_A01_t02; | ||
|
||
import augment 'applying_augmentation_library_A01_t02_lib.dart'; | ||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
part 'applying_augmentation_library_A01_t02_lib.dart'; | ||
|
||
main() { | ||
} |
16 changes: 16 additions & 0 deletions
16
LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A01_t02_lib.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,16 @@ | ||
// 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 It is a compile-time error if: | ||
/// - The library referenced in an `import augment` directive is not an | ||
/// augmentation and does not have a `library augment` directive. | ||
/// | ||
/// @description Check that it is a compile-time error if a library referenced | ||
/// in an `import augment` directive is not an does not have a `library augment` | ||
/// directive. Test the case when referenced library is part of the main library | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
part of applying_augmentation_library_A01_t02; |
23 changes: 23 additions & 0 deletions
23
LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A01_t03.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,23 @@ | ||
// 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 It is a compile-time error if: | ||
/// - The library referenced in an `import augment` directive is not an | ||
/// augmentation and does not have a `library augment` directive. | ||
/// | ||
/// @description Check that it is a compile-time error if a library referenced | ||
/// in an `import augment` directive is not an does not have a `library augment` | ||
/// directive. Test the case when a main library also imports the referenced one | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
import 'applying_augmentation_library_A01_t03_lib.dart'; | ||
import augment 'applying_augmentation_library_A01_t03_lib.dart'; | ||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
main() { | ||
} |
16 changes: 16 additions & 0 deletions
16
LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A01_t03_lib.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,16 @@ | ||
// 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 It is a compile-time error if: | ||
/// - The library referenced in an `import augment` directive is not an | ||
/// augmentation and does not have a `library augment` directive. | ||
/// | ||
/// @description Check that it is a compile-time error if a library referenced | ||
/// in an `import augment` directive is not an does not have a `library augment` | ||
/// directive. Test the case when a main library also imports the referenced one | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
library applying_augmentation_library_A01_t03; |
20 changes: 20 additions & 0 deletions
20
LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A02_t01.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,20 @@ | ||
// 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 It is a compile-time error if: | ||
/// ... | ||
/// - The library referenced in a `library augment` directive does not have an | ||
/// `import augment` directive pointing back to this augmentation. | ||
/// | ||
/// @description Check that it is a compile-time error if a library referenced | ||
/// in an `library augment` directive is not an does not have a `import augment` | ||
/// directive | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
import 'applying_augmentation_library_A02_t01_lib.dart'; | ||
|
||
main() { | ||
} |
19 changes: 19 additions & 0 deletions
19
LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A02_t01_lib.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,19 @@ | ||
// 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 It is a compile-time error if: | ||
/// ... | ||
/// - The library referenced in a `library augment` directive does not have an | ||
/// `import augment` directive pointing back to this augmentation. | ||
/// | ||
/// @description Check that it is a compile-time error if a library referenced | ||
/// in an `library augment` directive does not have a `import augment` directive | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
library augment 'applying_augmentation_library_A02_t01.dart'; | ||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified |
21 changes: 21 additions & 0 deletions
21
LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A02_t02.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,21 @@ | ||
// 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 It is a compile-time error if: | ||
/// ... | ||
/// - The library referenced in a `library augment` directive does not have an | ||
/// `import augment` directive pointing back to this augmentation. | ||
/// | ||
/// @description Check that it is a compile-time error if a library referenced | ||
/// in an `library augment` directive is not an does not have a `import augment` | ||
/// directive pointing back to this augmentation. | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
import 'applying_augmentation_library_A02_t02_lib1.dart'; | ||
import augment 'applying_augmentation_library_A02_t02_lib2.dart'; | ||
|
||
main() { | ||
} |
23 changes: 23 additions & 0 deletions
23
LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A02_t02_lib1.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,23 @@ | ||
// 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 It is a compile-time error if: | ||
/// ... | ||
/// - The library referenced in a `library augment` directive does not have an | ||
/// `import augment` directive pointing back to this augmentation. | ||
/// | ||
/// @description Check that it is a compile-time error if a library referenced | ||
/// in an `library augment` directive is not an does not have a `import augment` | ||
/// directive pointing back to this augmentation. | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
library augment 'applying_augmentation_library_A02_t02.dart'; | ||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
// 'applying_augmentation_library_A02_t02.dart' is pointing back to | ||
// 'applying_augmentation_library_A02_t02_lib2.dart' but not to this library |
19 changes: 19 additions & 0 deletions
19
LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A02_t02_lib2.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,19 @@ | ||
// 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 It is a compile-time error if: | ||
/// ... | ||
/// - The library referenced in a `library augment` directive does not have an | ||
/// `import augment` directive pointing back to this augmentation. | ||
/// | ||
/// @description Check that it is a compile-time error if a library referenced | ||
/// in an `library augment` directive is not an does not have a `import augment` | ||
/// directive pointing back to this augmentation. | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
library augment 'applying_augmentation_library_A02_t02.dart'; | ||
|
||
// Another augmentation library of 'applying_augmentation_library_A02_t02.dart' |
22 changes: 22 additions & 0 deletions
22
LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A03_t01.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,22 @@ | ||
// 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 It is a compile-time error if: | ||
/// ... | ||
/// - The same augmentation library is applied more than once. | ||
/// | ||
/// @description Check that it is a compile-time error if the same augmentation | ||
/// library is applied more than once. | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
import augment 'applying_augmentation_library_A03_t01_lib.dart'; | ||
import augment 'applying_augmentation_library_A03_t01_lib.dart'; | ||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
main() { | ||
} |
15 changes: 15 additions & 0 deletions
15
LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A03_t01_lib.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,15 @@ | ||
// 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 It is a compile-time error if: | ||
/// ... | ||
/// - The same augmentation library is applied more than once. | ||
/// | ||
/// @description Check that it is a compile-time error if the same augmentation | ||
/// library is applied more than once. | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
library augment 'applying_augmentation_library_A03_t01.dart'; |
17 changes: 17 additions & 0 deletions
17
LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A03_t02.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,17 @@ | ||
// 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 It is a compile-time error if there is more than one library | ||
/// directive in a single file | ||
/// | ||
/// @description Check that it is a compile-time error if there is more than one | ||
/// library directive in a single file | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
import augment 'applying_augmentation_library_A03_t02_lib.dart'; | ||
|
||
main() { | ||
} |
18 changes: 18 additions & 0 deletions
18
LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A03_t02_lib.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,18 @@ | ||
// 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 It is a compile-time error if there is more than one library | ||
/// directive in a single file | ||
/// | ||
/// @description Check that it is a compile-time error if there is more than one | ||
/// library directive in a single file | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
library augment 'applying_augmentation_library_A03_t02.dart'; | ||
/**/library; | ||
// ^^^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified |
23 changes: 23 additions & 0 deletions
23
LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A04_t01.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,23 @@ | ||
// 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 It is a compile-time error if: | ||
/// ... | ||
/// - The main library and its augmentations do not all have the same language | ||
/// version. There is only one user-visible library at the end, and it should | ||
/// have a consistent version across its entire surface area. | ||
/// | ||
/// @description Check that it is a compile-time error if an augmentation | ||
/// library has version lower than main. | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
import augment 'applying_augmentation_library_A04_t01_lib.dart'; | ||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
main() { | ||
} |
19 changes: 19 additions & 0 deletions
19
LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A04_t01_lib.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,19 @@ | ||
// 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 It is a compile-time error if: | ||
/// ... | ||
/// - The main library and its augmentations do not all have the same language | ||
/// version. There is only one user-visible library at the end, and it should | ||
/// have a consistent version across its entire surface area. | ||
/// | ||
/// @description Check that it is a compile-time error if an augmentation | ||
/// library has version lower than main. | ||
/// @author [email protected] | ||
// @dart=3.3 | ||
|
||
// SharedOptions=--enable-experiment=macros | ||
|
||
library augment 'applying_augmentation_library_A04_t01.dart'; |
25 changes: 25 additions & 0 deletions
25
LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A04_t02.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,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 It is a compile-time error if: | ||
/// ... | ||
/// - The main library and its augmentations do not all have the same language | ||
/// version. There is only one user-visible library at the end, and it should | ||
/// have a consistent version across its entire surface area. | ||
/// | ||
/// @description Check that it is a compile-time error if a main library has | ||
/// version lower than augmentation. | ||
/// @author [email protected] | ||
// @dart=3.3 | ||
|
||
// SharedOptions=--enable-experiment=macros | ||
|
||
import augment 'applying_augmentation_library_A04_t02_lib.dart'; | ||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
main() { | ||
} |
17 changes: 17 additions & 0 deletions
17
LanguageFeatures/Augmentation-libraries/applying_augmentation_library_A04_t02_lib.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,17 @@ | ||
// 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 It is a compile-time error if: | ||
/// ... | ||
/// - The main library and its augmentations do not all have the same language | ||
/// version. There is only one user-visible library at the end, and it should | ||
/// have a consistent version across its entire surface area. | ||
/// | ||
/// @description Check that it is a compile-time error if an augmentation | ||
/// library has version lower than main. | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
library augment 'applying_augmentation_library_A04_t02.dart'; |