Skip to content

Commit dbaf041

Browse files
munificentCommit Queue
authored andcommitted
Format tests/language/p*.
Change-Id: Ia3238c1781422ec5eb7a219a5cf8af645a4c5876 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/409000 Commit-Queue: Bob Nystrom <[email protected]> Reviewed-by: Lasse Nielsen <[email protected]> Auto-Submit: Bob Nystrom <[email protected]>
1 parent 4fbcd11 commit dbaf041

File tree

105 files changed

+1423
-1174
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+1423
-1174
lines changed

tests/language/parameter/bad_named2_runtime_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@ main() {
1818
BadNamedParameters2Test np = new BadNamedParameters2Test();
1919

2020
// No formal parameter named b.
21-
2221
}

tests/language/parameter/bad_named2_test.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ main() {
1616

1717
// No formal parameter named b.
1818
np.foo(b: 25);
19-
// ^
20-
// [analyzer] COMPILE_TIME_ERROR.NOT_ENOUGH_POSITIONAL_ARGUMENTS
21-
// ^^^^^^^
19+
// ^
2220
// [cfe] Too few positional arguments: 1 required, 0 given.
2321
// ^
22+
// [analyzer] COMPILE_TIME_ERROR.NOT_ENOUGH_POSITIONAL_ARGUMENTS
2423
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_NAMED_PARAMETER
2524
}

tests/language/parameter/bad_named_parameters_test.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ main() {
2020

2121
// Parameter b passed twice.
2222
np.f42(10, 25, b: 25);
23+
// ^
24+
// [cfe] Too many positional arguments: 1 allowed, but 2 found.
2325
// ^^
2426
// [analyzer] COMPILE_TIME_ERROR.EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED
25-
// ^^^^^^^^^^^^^^^
26-
// [cfe] Too many positional arguments: 1 allowed, but 2 found.
2727

2828
// Parameter x does not exist.
2929
np.f42(10, 25, x: 99);
30+
// ^
31+
// [cfe] Too many positional arguments: 1 allowed, but 2 found.
3032
// ^^
3133
// [analyzer] COMPILE_TIME_ERROR.EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED
32-
// ^^^^^^^^^^^^^^^
33-
// [cfe] Too many positional arguments: 1 allowed, but 2 found.
3434
// ^
3535
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_NAMED_PARAMETER
3636

@@ -42,15 +42,15 @@ main() {
4242

4343
// Too many parameters.
4444
np.f42(10, 20, 30, 40);
45+
// ^
46+
// [cfe] Too many positional arguments: 1 allowed, but 4 found.
4547
// ^^
4648
// [analyzer] COMPILE_TIME_ERROR.EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED
47-
// ^^^^^^^^^^^^^^^^
48-
// [cfe] Too many positional arguments: 1 allowed, but 4 found.
4949

5050
// Too few parameters.
5151
np.f42(b: 25);
52+
// ^
53+
// [cfe] Too few positional arguments: 1 required, 0 given.
5254
// ^
5355
// [analyzer] COMPILE_TIME_ERROR.NOT_ENOUGH_POSITIONAL_ARGUMENTS
54-
// ^^^^^^^
55-
// [cfe] Too few positional arguments: 1 required, 0 given.
5656
}

tests/language/parameter/bad_named_runtime_test.dart

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,11 @@ main() {
2323

2424
// Parameter b passed twice.
2525

26-
2726
// Parameter x does not exist.
2827

29-
3028
// Parameter b1 does not exist.
3129

32-
3330
// Too many parameters.
3431

35-
3632
// Too few parameters.
37-
3833
}

tests/language/parameter/initializer1_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ class Foo {
99
foo(this.x) {}
1010
// ^^^^
1111
// [analyzer] SYNTACTIC_ERROR.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR
12-
// [cfe] Field formal parameters can only be used in a constructor.
1312
// ^^^^^^
1413
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR
14+
// [cfe] Field formal parameters can only be used in a constructor.
1515
}
1616

1717
main() {

tests/language/parameter/initializer2_test.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ class E {
6565

6666
// mixed
6767
class F {
68-
F(x, this.y_, int w, int this.z)
69-
: x_ = x,
70-
w_ = w {}
68+
F(x, this.y_, int w, int this.z) : x_ = x, w_ = w {}
7169
F.foobar(this.z, int this.x_, int this.az_) {}
7270
int x_;
7371
late int y_;

tests/language/parameter/initializer4_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ class Foo {
99
static foo(this.x) {}
1010
// ^^^^
1111
// [analyzer] SYNTACTIC_ERROR.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR
12-
// [cfe] Field formal parameters can only be used in a constructor.
1312
// ^^^^^^
1413
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR
14+
// [cfe] Field formal parameters can only be used in a constructor.
1515
}
1616

1717
main() {

tests/language/parameter/initializer7_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ class Foo {
99
set y(this.x) {}
1010
// ^^^^
1111
// [analyzer] SYNTACTIC_ERROR.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR
12-
// [cfe] Field formal parameters can only be used in a constructor.
1312
// ^^^^^^
1413
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR
14+
// [cfe] Field formal parameters can only be used in a constructor.
1515
}
1616

1717
main() {

tests/language/parameter/initializer_test.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ class Foo {
4444
}
4545

4646
class SubFoo extends Foo {
47-
SubFoo(num y)
48-
: x_ = 0,
49-
super(y) {
47+
SubFoo(num y) : x_ = 0, super(y) {
5048
// Subfoo.setter of x has been invoked in the Foo constructor.
5149
Expect.equals(x, 1);
5250
Expect.equals(x_, 1);

tests/language/parameter/named_aggregated_runtime_test.dart

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,47 +10,33 @@ class TypeTester<T> {}
1010

1111
// Expect compile-time error as no default values are allowed
1212
// in closure type definitions.
13-
typedef void Callback([String msg
14-
15-
]);
13+
typedef void Callback([String msg]);
1614

1715
class NamedParametersAggregatedTests {
1816
static int F31(int a, {int b = 20, int c = 30}) {
1917
return 100 * (100 * a + b) + c;
2018
}
2119

22-
static int f_missing_comma(a
23-
24-
) =>
25-
a;
20+
static int f_missing_comma(a) => a;
2621

2722
var _handler = null;
2823

2924
// Expect compile-time error as no default values
3025
// are allowed in closure type.
31-
void InstallCallback(
32-
void cb({String msg
33-
34-
})?) {
26+
void InstallCallback(void cb({String msg})?) {
3527
_handler = cb;
3628
}
3729
}
3830

3931
main() {
4032
// Expect compile-time error due to missing comma in function definition.
41-
NamedParametersAggregatedTests.f_missing_comma(10
42-
43-
);
33+
NamedParametersAggregatedTests.f_missing_comma(10);
4434

4535
// Expect compile-time error due to duplicate named argument.
46-
NamedParametersAggregatedTests.F31(10, b: 25
47-
48-
49-
);
36+
NamedParametersAggregatedTests.F31(10, b: 25);
5037

5138
// Expect compile-time error due to missing positional argument.
5239

53-
5440
new TypeTester<Callback>();
5541

5642
(new NamedParametersAggregatedTests()).InstallCallback(null);

0 commit comments

Comments
 (0)