Skip to content

Commit 6f66c12

Browse files
munificentCommit Queue
authored andcommitted
Reformat tests/language/assert/.
Change-Id: I333977cf5738c39f6754c7ecbab8eea8751e761c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/399861 Reviewed-by: Lasse Nielsen <[email protected]> Auto-Submit: Bob Nystrom <[email protected]> Commit-Queue: Bob Nystrom <[email protected]>
1 parent 6bd57e4 commit 6f66c12

10 files changed

+112
-177
lines changed
Lines changed: 8 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// TODO(multitest): This was automatically migrated from a multitest and may
2-
// contain strange or dead code.
3-
41
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
52
// for details. All rights reserved. Use of this source code is governed by a
63
// BSD-style license that can be found in the LICENSE file.
@@ -15,73 +12,47 @@ class C {
1512
final int x;
1613
// Const constructors.
1714
const C.cc01(this.x, y) : assert(x < y);
18-
const C.cc02(x, y)
19-
: x = x,
20-
assert(x < y);
21-
const C.cc03(x, y)
22-
: assert(x < y),
23-
x = x;
24-
const C.cc04(this.x, y)
25-
: assert(x < y),
26-
super();
27-
const C.cc05(x, y)
28-
: x = x,
29-
assert(x < y),
30-
super();
31-
const C.cc06(x, y)
32-
: assert(x < y),
33-
x = x,
34-
super();
35-
const C.cc07(x, y)
36-
: assert(x < y),
37-
x = x,
38-
assert(y > x),
39-
super();
15+
const C.cc02(x, y) : x = x, assert(x < y);
16+
const C.cc03(x, y) : assert(x < y), x = x;
17+
const C.cc04(this.x, y) : assert(x < y), super();
18+
const C.cc05(x, y) : x = x, assert(x < y), super();
19+
const C.cc06(x, y) : assert(x < y), x = x, super();
20+
const C.cc07(x, y) : assert(x < y), x = x, assert(y > x), super();
4021
const C.cc08(this.x, y) : assert(x < y, "$x < $y");
41-
const C.cc09(this.x, y) : assert(x < y,);
42-
const C.cc10(this.x, y) : assert(x < y, "$x < $y",);
22+
const C.cc09(this.x, y) : assert(x < y);
23+
const C.cc10(this.x, y) : assert(x < y, "$x < $y");
4324
}
4425

4526
main() {
4627
const x = 3;
4728
{
48-
4929
const C.cc01(2, x);
5030
}
5131
{
52-
5332
const C.cc02(2, x);
5433
}
5534
{
56-
5735
const C.cc03(2, x);
5836
}
5937
{
60-
6138
const C.cc04(2, x);
6239
}
6340
{
64-
6541
const C.cc05(2, x);
6642
}
6743
{
68-
6944
const C.cc06(2, x);
7045
}
7146
{
72-
7347
const C.cc07(2, x);
7448
}
7549
{
76-
7750
const C.cc08(2, x);
7851
}
7952
{
80-
8153
const C.cc09(2, x);
8254
}
8355
{
84-
8556
const C.cc10(2, x);
8657
}
8758
}
Lines changed: 49 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,124 +1,104 @@
11
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
4-
// VMOptions=--enable-asserts
5-
// dart2jsOptions=--enable-asserts
6-
//
7-
// Test of asserts in initializer lists.
84

5+
// Test of asserts in initializer lists.
96
import "package:expect/expect.dart";
107

118
class C {
129
final int x;
1310
// Const constructors.
1411
const C.cc01(this.x, y) : assert(x < y);
15-
const C.cc02(x, y)
16-
: x = x,
17-
assert(x < y);
18-
const C.cc03(x, y)
19-
: assert(x < y),
20-
x = x;
21-
const C.cc04(this.x, y)
22-
: assert(x < y),
23-
super();
24-
const C.cc05(x, y)
25-
: x = x,
26-
assert(x < y),
27-
super();
28-
const C.cc06(x, y)
29-
: assert(x < y),
30-
x = x,
31-
super();
32-
const C.cc07(x, y)
33-
: assert(x < y),
34-
x = x,
35-
assert(y > x),
36-
super();
12+
const C.cc02(x, y) : x = x, assert(x < y);
13+
const C.cc03(x, y) : assert(x < y), x = x;
14+
const C.cc04(this.x, y) : assert(x < y), super();
15+
const C.cc05(x, y) : x = x, assert(x < y), super();
16+
const C.cc06(x, y) : assert(x < y), x = x, super();
17+
const C.cc07(x, y) : assert(x < y), x = x, assert(y > x), super();
3718
const C.cc08(this.x, y) : assert(x < y, "$x < $y");
38-
const C.cc09(this.x, y) : assert(x < y,);
39-
const C.cc10(this.x, y) : assert(x < y, "$x < $y",);
19+
const C.cc09(this.x, y) : assert(x < y);
20+
const C.cc10(this.x, y) : assert(x < y, "$x < $y");
4021
}
4122

4223
main() {
43-
const x = 3;
4424
{
4525
const x = 1;
4626
const C.cc01(2, x);
47-
// ^^^^^^^^^^^^^^^^^^
48-
// [analyzer] COMPILE_TIME_ERROR.CONST_EVAL_THROWS_EXCEPTION
49-
// ^
50-
// [cfe] Constant evaluation error:
27+
// [error column 5, length 18]
28+
// [analyzer] COMPILE_TIME_ERROR.CONST_EVAL_THROWS_EXCEPTION
29+
// ^
30+
// [cfe] Constant evaluation error:
5131
}
5232
{
5333
const x = 1;
5434
const C.cc02(2, x);
55-
// ^^^^^^^^^^^^^^^^^^
56-
// [analyzer] COMPILE_TIME_ERROR.CONST_EVAL_THROWS_EXCEPTION
57-
// ^
58-
// [cfe] Constant evaluation error:
35+
// [error column 5, length 18]
36+
// [analyzer] COMPILE_TIME_ERROR.CONST_EVAL_THROWS_EXCEPTION
37+
// ^
38+
// [cfe] Constant evaluation error:
5939
}
6040
{
6141
const x = 1;
6242
const C.cc03(2, x);
63-
// ^^^^^^^^^^^^^^^^^^
64-
// [analyzer] COMPILE_TIME_ERROR.CONST_EVAL_THROWS_EXCEPTION
65-
// ^
66-
// [cfe] Constant evaluation error:
43+
// [error column 5, length 18]
44+
// [analyzer] COMPILE_TIME_ERROR.CONST_EVAL_THROWS_EXCEPTION
45+
// ^
46+
// [cfe] Constant evaluation error:
6747
}
6848
{
6949
const x = 1;
7050
const C.cc04(2, x);
71-
// ^^^^^^^^^^^^^^^^^^
72-
// [analyzer] COMPILE_TIME_ERROR.CONST_EVAL_THROWS_EXCEPTION
73-
// ^
74-
// [cfe] Constant evaluation error:
51+
// [error column 5, length 18]
52+
// [analyzer] COMPILE_TIME_ERROR.CONST_EVAL_THROWS_EXCEPTION
53+
// ^
54+
// [cfe] Constant evaluation error:
7555
}
7656
{
7757
const x = 1;
7858
const C.cc05(2, x);
79-
// ^^^^^^^^^^^^^^^^^^
80-
// [analyzer] COMPILE_TIME_ERROR.CONST_EVAL_THROWS_EXCEPTION
81-
// ^
82-
// [cfe] Constant evaluation error:
59+
// [error column 5, length 18]
60+
// [analyzer] COMPILE_TIME_ERROR.CONST_EVAL_THROWS_EXCEPTION
61+
// ^
62+
// [cfe] Constant evaluation error:
8363
}
8464
{
8565
const x = 1;
8666
const C.cc06(2, x);
87-
// ^^^^^^^^^^^^^^^^^^
88-
// [analyzer] COMPILE_TIME_ERROR.CONST_EVAL_THROWS_EXCEPTION
89-
// ^
90-
// [cfe] Constant evaluation error:
67+
// [error column 5, length 18]
68+
// [analyzer] COMPILE_TIME_ERROR.CONST_EVAL_THROWS_EXCEPTION
69+
// ^
70+
// [cfe] Constant evaluation error:
9171
}
9272
{
9373
const x = 1;
9474
const C.cc07(2, x);
95-
// ^^^^^^^^^^^^^^^^^^
96-
// [analyzer] COMPILE_TIME_ERROR.CONST_EVAL_THROWS_EXCEPTION
97-
// ^
98-
// [cfe] Constant evaluation error:
75+
// [error column 5, length 18]
76+
// [analyzer] COMPILE_TIME_ERROR.CONST_EVAL_THROWS_EXCEPTION
77+
// ^
78+
// [cfe] Constant evaluation error:
9979
}
10080
{
10181
const x = 1;
10282
const C.cc08(2, x);
103-
// ^^^^^^^^^^^^^^^^^^
104-
// [analyzer] COMPILE_TIME_ERROR.CONST_EVAL_THROWS_EXCEPTION
105-
// ^
106-
// [cfe] Constant evaluation error:
83+
// [error column 5, length 18]
84+
// [analyzer] COMPILE_TIME_ERROR.CONST_EVAL_THROWS_EXCEPTION
85+
// ^
86+
// [cfe] Constant evaluation error:
10787
}
10888
{
10989
const x = 1;
11090
const C.cc09(2, x);
111-
// ^^^^^^^^^^^^^^^^^^
112-
// [analyzer] COMPILE_TIME_ERROR.CONST_EVAL_THROWS_EXCEPTION
113-
// ^
114-
// [cfe] Constant evaluation error:
91+
// [error column 5, length 18]
92+
// [analyzer] COMPILE_TIME_ERROR.CONST_EVAL_THROWS_EXCEPTION
93+
// ^
94+
// [cfe] Constant evaluation error:
11595
}
11696
{
11797
const x = 1;
11898
const C.cc10(2, x);
119-
// ^^^^^^^^^^^^^^^^^^
120-
// [analyzer] COMPILE_TIME_ERROR.CONST_EVAL_THROWS_EXCEPTION
121-
// ^
122-
// [cfe] Constant evaluation error:
99+
// [error column 5, length 18]
100+
// [analyzer] COMPILE_TIME_ERROR.CONST_EVAL_THROWS_EXCEPTION
101+
// ^
102+
// [cfe] Constant evaluation error:
123103
}
124104
}

tests/language/assert/initializer_const_error_runtime_test.dart

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// TODO(multitest): This was automatically migrated from a multitest and may
2-
// contain strange or dead code.
3-
41
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
52
// for details. All rights reserved. Use of this source code is governed by a
63
// BSD-style license that can be found in the LICENSE file.
@@ -11,9 +8,7 @@ class C {
118
const C(this.x);
129
// The expression is not a potentially constant expression.
1310
// This is a compile-time error even in production mode.
14-
const C.bc03(this.x, y)
15-
16-
;
11+
const C.bc03(this.x, y);
1712
}
1813

1914
main() {

tests/language/assert/initializer_const_error_test.dart

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@ class C {
88
const C(this.x);
99
// The expression is not a potentially constant expression.
1010
// This is a compile-time error even in production mode.
11-
const C.bc03(this.x, y)
12-
: assert(check(x, y))
13-
// ^^^^^^^^^^^
14-
// [analyzer] COMPILE_TIME_ERROR.INVALID_CONSTANT
15-
// [cfe] Method invocation is not a constant expression.
16-
;
11+
const C.bc03(this.x, y) : assert(check(x, y));
12+
// ^^^^^^^^^^^
13+
// [analyzer] COMPILE_TIME_ERROR.INVALID_CONSTANT
14+
// [cfe] Method invocation is not a constant expression.
1715
}
1816

1917
main() {

tests/language/assert/initializer_const_function_runtime_test.dart

Lines changed: 0 additions & 21 deletions
This file was deleted.

tests/language/assert/initializer_const_function_test.dart

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@ class C {
88

99
// Functions as parameters to assert are no longer supported in Dart 2.0, so
1010
// this is now a static type error.
11-
const C.bc01(this.x, y)
12-
: assert(staticTrue)
13-
// ^^^^^^^^^^
14-
// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_EXPRESSION
15-
// [cfe] A value of type 'bool Function()' can't be assigned to a variable of type 'bool'.
16-
;
11+
const C.bc01(this.x, y) : assert(staticTrue);
12+
// ^^^^^^^^^^
13+
// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_EXPRESSION
14+
// [cfe] A value of type 'bool Function()' can't be assigned to a variable of type 'bool'.
1715
}
1816

1917
main() {

0 commit comments

Comments
 (0)