Skip to content

Commit

Permalink
dart-lang#2825. Update existing tests for Parts
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrekhov committed Sep 12, 2024
1 parent 1432a16 commit fa3236c
Show file tree
Hide file tree
Showing 52 changed files with 369 additions and 671 deletions.
14 changes: 6 additions & 8 deletions Language/Libraries_and_Scripts/Parts/compilation_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@
// 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 Compiling a part directive of the form part s; causes the Dart
/// system to attempt to compile the contents of the URI that is the value of s.
/// The top-level declarations at that URI are then compiled by the Dart compiler
/// in the scope of the current library. It is a compile-time error if the
/// contents of the URI are not a valid part declaration.
/// @assertion Compiling a part directive of the form `part s;` causes the Dart
/// system to attempt to compile the contents of the URI that is the value of
/// `s`. The top-level declarations at that URI are then compiled by the Dart
/// compiler in the scope of the current library.
///
/// @description Checks that it is a compile-time error when names in the
/// included file conflict with top-level definitions in this library.
/// @author rodionov
/// @issue 44990
library Parts_test_lib;
part "part_0.dart";
part "compilation_t01_part.dart";

var foo;

Expand Down
25 changes: 25 additions & 0 deletions Language/Libraries_and_Scripts/Parts/compilation_t01_part.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright (c) 2011, 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 Compiling a part directive of the form `part s;` causes the Dart
/// system to attempt to compile the contents of the URI that is the value of
/// `s`. The top-level declarations at that URI are then compiled by the Dart
/// compiler in the scope of the current library.
///
/// @description Checks that it is a compile-time error when names in the
/// included file conflict with top-level definitions in this library.
/// @author rodionov
@Annot()
part of "compilation_t01.dart";

class Annot {
const Annot();
}

final foo = "foo";
// ^^^
// [analyzer] unspecified
// [cfe] unspecified
var bar = 1;
23 changes: 0 additions & 23 deletions Language/Libraries_and_Scripts/Parts/compilation_t02.dart

This file was deleted.

13 changes: 6 additions & 7 deletions Language/Libraries_and_Scripts/Parts/compilation_t03.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@
// 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 Compiling a part directive of the form part s; causes the Dart
/// system to attempt to compile the contents of the URI that is the value of s.
/// The top-level declarations at that URI are then compiled by the Dart compiler
/// in the scope of the current library. It is a compile-time error if the
/// contents of the URI are not a valid part declaration.
/// @assertion Compiling a part directive of the form `part s;` causes the Dart
/// system to attempt to compile the contents of the URI that is the value of
/// `s`. The top-level declarations at that URI are then compiled by the Dart
/// compiler in the scope of the current library.
///
/// @description Checks that the top level declarations at URI are compiled in
/// the scope of the current library (including private declarations).
/// @Issue 42393
/// @author rodionov
library Parts_test_lib;
import "../../../Utils/expect.dart";
part "part_2.dart";
part "compilation_t03_part.dart";

main() {
//functions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
// 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.

part of Parts_test_lib;
/// @assertion Compiling a part directive of the form `part s;` causes the Dart
/// system to attempt to compile the contents of the URI that is the value of
/// `s`. The top-level declarations at that URI are then compiled by the Dart
/// compiler in the scope of the current library.
///
/// @description Checks that the top level declarations at URI are compiled in
/// the scope of the current library (including private declarations).
part of 'compilation_t03.dart';

foo() { return null; }
int bar(int x, int y) { return x + y ; }
Expand All @@ -15,7 +23,6 @@ get value { return _value; }
set value(value) { _value = value; }
var _value;


final int i = -100;
final bool b = false;
final String s = "string";
Expand Down
14 changes: 6 additions & 8 deletions Language/Libraries_and_Scripts/Parts/compilation_t04.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,18 @@
// 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 Compiling a part directive of the form part s; causes the Dart
/// system to attempt to compile the contents of the URI that is the value of s.
/// The top-level declarations at that URI are then compiled by the Dart compiler
/// in the scope of the current library. It is a compile-time error if the
/// contents of the URI are not a valid part declaration.
/// @assertion Compiling a part directive of the form `part s;` causes the Dart
/// system to attempt to compile the contents of the URI that is the value of
/// `s`. The top-level declarations at that URI are then compiled by the Dart
/// compiler in the scope of the current library.
///
/// @description Checks that more than one part can be included in a library
/// without errors as long as there are no name conflicts.
/// @author rodionov
library Parts_test_lib;
import "../../../Utils/expect.dart";
part "part_3.dart";
part "part_12.dart";
part "compilation_t04_part1.dart";
part "compilation_t04_part2.dart";

main() {
// get/set
Expand Down
19 changes: 19 additions & 0 deletions Language/Libraries_and_Scripts/Parts/compilation_t04_part1.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright (c) 2011, 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 Compiling a part directive of the form `part s;` causes the Dart
/// system to attempt to compile the contents of the URI that is the value of
/// `s`. The top-level declarations at that URI are then compiled by the Dart
/// compiler in the scope of the current library.
///
/// @description Checks that more than one part can be included in a library
/// without errors as long as there are no name conflicts.
part of 'compilation_t04.dart';

class A { }

get value { return _value; }
set value(value) { _value = value; }
var _value;
21 changes: 21 additions & 0 deletions Language/Libraries_and_Scripts/Parts/compilation_t04_part2.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 Compiling a part directive of the form `part s;` causes the Dart
/// system to attempt to compile the contents of the URI that is the value of
/// `s`. The top-level declarations at that URI are then compiled by the Dart
/// compiler in the scope of the current library.
///
/// @description Checks that more than one part can be included in a library
/// without errors as long as there are no name conflicts.
@Annot()
part of 'compilation_t04.dart';

class Annot {
const Annot();
}

final foo = "foo";
var bar = 1;
60 changes: 0 additions & 60 deletions Language/Libraries_and_Scripts/Parts/compilation_t05.dart

This file was deleted.

20 changes: 0 additions & 20 deletions Language/Libraries_and_Scripts/Parts/compilation_t06.dart

This file was deleted.

25 changes: 0 additions & 25 deletions Language/Libraries_and_Scripts/Parts/compilation_t07.dart

This file was deleted.

19 changes: 0 additions & 19 deletions Language/Libraries_and_Scripts/Parts/compilation_t08.dart

This file was deleted.

22 changes: 0 additions & 22 deletions Language/Libraries_and_Scripts/Parts/compilation_t09.dart

This file was deleted.

24 changes: 0 additions & 24 deletions Language/Libraries_and_Scripts/Parts/compilation_t10.dart

This file was deleted.

21 changes: 0 additions & 21 deletions Language/Libraries_and_Scripts/Parts/compilation_t11.dart

This file was deleted.

Loading

0 comments on commit fa3236c

Please sign in to comment.