Skip to content

Commit

Permalink
dart-lang#2825. Add tests for "Terminology" chapter of the spec.
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrekhov committed Sep 10, 2024
1 parent a572236 commit 6aebca3
Show file tree
Hide file tree
Showing 12 changed files with 204 additions and 0 deletions.
18 changes: 18 additions & 0 deletions LanguageFeatures/Parts-with-imports/terminology_A01_t01.dart
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’s a compile-time error if a Dart file has two `part`
/// directives with the same URI, so each included part file is included exactly
/// once.
///
/// @description Check that it is a compile-time error if a Dart file has two
/// `part` directives with the same URI.
/// @author [email protected]
// SharedOptions=--enable-experiment=enhanced-parts

part 'terminology_A01_t01_part1.dart';

main() {
}
21 changes: 21 additions & 0 deletions LanguageFeatures/Parts-with-imports/terminology_A01_t01_part1.dart
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’s a compile-time error if a Dart file has two `part`
/// directives with the same URI, so each included part file is included exactly
/// once.
///
/// @description Check that it is a compile-time error if a Dart file has two
/// `part` directives with the same URI.
/// @author [email protected]
// SharedOptions=--enable-experiment=enhanced-parts

part of 'terminology_A01_t01.dart';

part 'terminology_A01_t01_part2.dart';
part 'terminology_A01_t01_part2.dart';
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
15 changes: 15 additions & 0 deletions LanguageFeatures/Parts-with-imports/terminology_A01_t01_part2.dart
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’s a compile-time error if a Dart file has two `part`
/// directives with the same URI, so each included part file is included exactly
/// once.
///
/// @description Check that it is a compile-time error if a Dart file has two
/// `part` directives with the same URI.
/// @author [email protected]
// SharedOptions=--enable-experiment=enhanced-parts

part of 'terminology_A01_t01_part1.dart';
17 changes: 17 additions & 0 deletions LanguageFeatures/Parts-with-imports/terminology_A02_t01.dart
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’s a compile-time error if a `part` directive denotes a file
/// which is not a part file.
///
/// @description Check that it is a compile-time error if a `part` directive
/// denotes a file which is not a part file.
/// @author [email protected]
// SharedOptions=--enable-experiment=enhanced-parts

part 'terminology_A02_t01_part1.dart';

main() {
}
19 changes: 19 additions & 0 deletions LanguageFeatures/Parts-with-imports/terminology_A02_t01_part1.dart
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’s a compile-time error if a `part` directive denotes a file
/// which is not a part file.
///
/// @description Check that it is a compile-time error if a `part` directive
/// denotes a file which is not a part file.
/// @author [email protected]
// SharedOptions=--enable-experiment=enhanced-parts

part of 'terminology_A02_t01.dart';

part 'terminology_A02_t01_part2.dart';
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
14 changes: 14 additions & 0 deletions LanguageFeatures/Parts-with-imports/terminology_A02_t01_part2.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// 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’s a compile-time error if a `part` directive denotes a file
/// which is not a part file.
///
/// @description Check that it is a compile-time error if a `part` directive
/// denotes a file which is not a part file.
/// @author [email protected]
// SharedOptions=--enable-experiment=enhanced-parts

String foo = "foo";
17 changes: 17 additions & 0 deletions LanguageFeatures/Parts-with-imports/terminology_A03_t01.dart
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’s a compile-time error if a part file is included by any Dart
/// file other than the part file’s parent file.
///
/// @description Check that it is a compile-time error if a `part` directive
/// denotes a file which is not a part file.
/// @author [email protected]
// SharedOptions=--enable-experiment=enhanced-parts

part 'terminology_A03_t01_part1.dart';

main() {
}
19 changes: 19 additions & 0 deletions LanguageFeatures/Parts-with-imports/terminology_A03_t01_part1.dart
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’s a compile-time error if a `part` directive denotes a file
/// which is not a part file.
///
/// @description Check that it is a compile-time error if a `part` directive
/// denotes a file which is not a part file.
/// @author [email protected]
// SharedOptions=--enable-experiment=enhanced-parts

part of 'terminology_A03_t01.dart';

part 'terminology_A03_t01_part2.dart';
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
14 changes: 14 additions & 0 deletions LanguageFeatures/Parts-with-imports/terminology_A03_t01_part2.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// 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’s a compile-time error if a `part` directive denotes a file
/// which is not a part file.
///
/// @description Check that it is a compile-time error if a `part` directive
/// denotes a file which is not a part file.
/// @author [email protected]
// SharedOptions=--enable-experiment=enhanced-parts

String foo = "foo";
16 changes: 16 additions & 0 deletions LanguageFeatures/Parts-with-imports/terminology_A04_t01.dart
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’s a compile-time error if a part file is a sub-part of itself.
///
/// @description Check that it is a compile-time error if a part file is a
/// sub-part of itself.
/// @author [email protected]
// SharedOptions=--enable-experiment=enhanced-parts

part 'terminology_A04_t01_part1.dart';

main() {
}
15 changes: 15 additions & 0 deletions LanguageFeatures/Parts-with-imports/terminology_A04_t01_part1.dart
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’s a compile-time error if a part file is a sub-part of itself.
///
/// @description Check that it is a compile-time error if a part file is a
/// sub-part of itself.
/// @author [email protected]
// SharedOptions=--enable-experiment=enhanced-parts

part of 'terminology_A04_t01.dart';

part 'terminology_A04_t01_part2.dart';
19 changes: 19 additions & 0 deletions LanguageFeatures/Parts-with-imports/terminology_A04_t01_part2.dart
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’s a compile-time error if a `part` directive denotes a file
/// which is not a part file.
///
/// @description Check that it is a compile-time error if a `part` directive
/// denotes a file which is not a part file.
/// @author [email protected]
// SharedOptions=--enable-experiment=enhanced-parts

part of 'terminology_A04_t01_part1.dart';

part 'terminology_A04_t01.dart';
// ^^^^^^^^^^^^^^^^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

0 comments on commit 6aebca3

Please sign in to comment.