From 6aebca36a744d44d93af9998af6e9f83fbf9df05 Mon Sep 17 00:00:00 2001 From: sgrekhov Date: Tue, 10 Sep 2024 16:17:18 +0300 Subject: [PATCH] #2825. Add tests for "Terminology" chapter of the spec. --- .../terminology_A01_t01.dart | 18 ++++++++++++++++ .../terminology_A01_t01_part1.dart | 21 +++++++++++++++++++ .../terminology_A01_t01_part2.dart | 15 +++++++++++++ .../terminology_A02_t01.dart | 17 +++++++++++++++ .../terminology_A02_t01_part1.dart | 19 +++++++++++++++++ .../terminology_A02_t01_part2.dart | 14 +++++++++++++ .../terminology_A03_t01.dart | 17 +++++++++++++++ .../terminology_A03_t01_part1.dart | 19 +++++++++++++++++ .../terminology_A03_t01_part2.dart | 14 +++++++++++++ .../terminology_A04_t01.dart | 16 ++++++++++++++ .../terminology_A04_t01_part1.dart | 15 +++++++++++++ .../terminology_A04_t01_part2.dart | 19 +++++++++++++++++ 12 files changed, 204 insertions(+) create mode 100644 LanguageFeatures/Parts-with-imports/terminology_A01_t01.dart create mode 100644 LanguageFeatures/Parts-with-imports/terminology_A01_t01_part1.dart create mode 100644 LanguageFeatures/Parts-with-imports/terminology_A01_t01_part2.dart create mode 100644 LanguageFeatures/Parts-with-imports/terminology_A02_t01.dart create mode 100644 LanguageFeatures/Parts-with-imports/terminology_A02_t01_part1.dart create mode 100644 LanguageFeatures/Parts-with-imports/terminology_A02_t01_part2.dart create mode 100644 LanguageFeatures/Parts-with-imports/terminology_A03_t01.dart create mode 100644 LanguageFeatures/Parts-with-imports/terminology_A03_t01_part1.dart create mode 100644 LanguageFeatures/Parts-with-imports/terminology_A03_t01_part2.dart create mode 100644 LanguageFeatures/Parts-with-imports/terminology_A04_t01.dart create mode 100644 LanguageFeatures/Parts-with-imports/terminology_A04_t01_part1.dart create mode 100644 LanguageFeatures/Parts-with-imports/terminology_A04_t01_part2.dart diff --git a/LanguageFeatures/Parts-with-imports/terminology_A01_t01.dart b/LanguageFeatures/Parts-with-imports/terminology_A01_t01.dart new file mode 100644 index 0000000000..4560bf1b8e --- /dev/null +++ b/LanguageFeatures/Parts-with-imports/terminology_A01_t01.dart @@ -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 sgrekhov22@gmail.com + +// SharedOptions=--enable-experiment=enhanced-parts + +part 'terminology_A01_t01_part1.dart'; + +main() { +} diff --git a/LanguageFeatures/Parts-with-imports/terminology_A01_t01_part1.dart b/LanguageFeatures/Parts-with-imports/terminology_A01_t01_part1.dart new file mode 100644 index 0000000000..05eb3f6319 --- /dev/null +++ b/LanguageFeatures/Parts-with-imports/terminology_A01_t01_part1.dart @@ -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 sgrekhov22@gmail.com + +// 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 diff --git a/LanguageFeatures/Parts-with-imports/terminology_A01_t01_part2.dart b/LanguageFeatures/Parts-with-imports/terminology_A01_t01_part2.dart new file mode 100644 index 0000000000..0fd1eb1bff --- /dev/null +++ b/LanguageFeatures/Parts-with-imports/terminology_A01_t01_part2.dart @@ -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 sgrekhov22@gmail.com + +// SharedOptions=--enable-experiment=enhanced-parts + +part of 'terminology_A01_t01_part1.dart'; diff --git a/LanguageFeatures/Parts-with-imports/terminology_A02_t01.dart b/LanguageFeatures/Parts-with-imports/terminology_A02_t01.dart new file mode 100644 index 0000000000..b971fae63e --- /dev/null +++ b/LanguageFeatures/Parts-with-imports/terminology_A02_t01.dart @@ -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 sgrekhov22@gmail.com + +// SharedOptions=--enable-experiment=enhanced-parts + +part 'terminology_A02_t01_part1.dart'; + +main() { +} diff --git a/LanguageFeatures/Parts-with-imports/terminology_A02_t01_part1.dart b/LanguageFeatures/Parts-with-imports/terminology_A02_t01_part1.dart new file mode 100644 index 0000000000..92add88157 --- /dev/null +++ b/LanguageFeatures/Parts-with-imports/terminology_A02_t01_part1.dart @@ -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 sgrekhov22@gmail.com + +// SharedOptions=--enable-experiment=enhanced-parts + +part of 'terminology_A02_t01.dart'; + +part 'terminology_A02_t01_part2.dart'; +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +// [analyzer] unspecified +// [cfe] unspecified diff --git a/LanguageFeatures/Parts-with-imports/terminology_A02_t01_part2.dart b/LanguageFeatures/Parts-with-imports/terminology_A02_t01_part2.dart new file mode 100644 index 0000000000..54c6c755d7 --- /dev/null +++ b/LanguageFeatures/Parts-with-imports/terminology_A02_t01_part2.dart @@ -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 sgrekhov22@gmail.com + +// SharedOptions=--enable-experiment=enhanced-parts + +String foo = "foo"; diff --git a/LanguageFeatures/Parts-with-imports/terminology_A03_t01.dart b/LanguageFeatures/Parts-with-imports/terminology_A03_t01.dart new file mode 100644 index 0000000000..204e35761f --- /dev/null +++ b/LanguageFeatures/Parts-with-imports/terminology_A03_t01.dart @@ -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 sgrekhov22@gmail.com + +// SharedOptions=--enable-experiment=enhanced-parts + +part 'terminology_A03_t01_part1.dart'; + +main() { +} diff --git a/LanguageFeatures/Parts-with-imports/terminology_A03_t01_part1.dart b/LanguageFeatures/Parts-with-imports/terminology_A03_t01_part1.dart new file mode 100644 index 0000000000..a7e5369948 --- /dev/null +++ b/LanguageFeatures/Parts-with-imports/terminology_A03_t01_part1.dart @@ -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 sgrekhov22@gmail.com + +// SharedOptions=--enable-experiment=enhanced-parts + +part of 'terminology_A03_t01.dart'; + +part 'terminology_A03_t01_part2.dart'; +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +// [analyzer] unspecified +// [cfe] unspecified diff --git a/LanguageFeatures/Parts-with-imports/terminology_A03_t01_part2.dart b/LanguageFeatures/Parts-with-imports/terminology_A03_t01_part2.dart new file mode 100644 index 0000000000..54c6c755d7 --- /dev/null +++ b/LanguageFeatures/Parts-with-imports/terminology_A03_t01_part2.dart @@ -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 sgrekhov22@gmail.com + +// SharedOptions=--enable-experiment=enhanced-parts + +String foo = "foo"; diff --git a/LanguageFeatures/Parts-with-imports/terminology_A04_t01.dart b/LanguageFeatures/Parts-with-imports/terminology_A04_t01.dart new file mode 100644 index 0000000000..52fe4ad9a7 --- /dev/null +++ b/LanguageFeatures/Parts-with-imports/terminology_A04_t01.dart @@ -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 sgrekhov22@gmail.com + +// SharedOptions=--enable-experiment=enhanced-parts + +part 'terminology_A04_t01_part1.dart'; + +main() { +} diff --git a/LanguageFeatures/Parts-with-imports/terminology_A04_t01_part1.dart b/LanguageFeatures/Parts-with-imports/terminology_A04_t01_part1.dart new file mode 100644 index 0000000000..e1ef4f976c --- /dev/null +++ b/LanguageFeatures/Parts-with-imports/terminology_A04_t01_part1.dart @@ -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 sgrekhov22@gmail.com + +// SharedOptions=--enable-experiment=enhanced-parts + +part of 'terminology_A04_t01.dart'; + +part 'terminology_A04_t01_part2.dart'; diff --git a/LanguageFeatures/Parts-with-imports/terminology_A04_t01_part2.dart b/LanguageFeatures/Parts-with-imports/terminology_A04_t01_part2.dart new file mode 100644 index 0000000000..fd90fce523 --- /dev/null +++ b/LanguageFeatures/Parts-with-imports/terminology_A04_t01_part2.dart @@ -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 sgrekhov22@gmail.com + +// SharedOptions=--enable-experiment=enhanced-parts + +part of 'terminology_A04_t01_part1.dart'; + +part 'terminology_A04_t01.dart'; +// ^^^^^^^^^^^^^^^^^^^^^^^^ +// [analyzer] unspecified +// [cfe] unspecified