Skip to content

Commit

Permalink
Opt multitests out of formatting in language/.
Browse files Browse the repository at this point in the history
The new formatter supports opting a region of code out from being
formatted. I'm applying this marker to all of the multitests since
those tests are often very sensitive to formatting and easily broken.
This way, anyone touching a multitest (including me when I reformat
the tests) doesn't have to remember to not run the formatter on it.

Unfortunately, this doesn't opt out 100# of the multitests. There are a
handful of multitests that also contain "@Dart=" comments and are thus
formatted using the old style where the "// dart format off" marker has
no effect. For those, we'll have to still be careful to not accidentally
format them.

Change-Id: I257d0ee1eb44eee57047be06b8520f0ccc7b56d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396162
Auto-Submit: Bob Nystrom <[email protected]>
Commit-Queue: Erik Ernst <[email protected]>
Reviewed-by: Erik Ernst <[email protected]>
  • Loading branch information
munificent authored and Commit Queue committed Nov 21, 2024
1 parent d6ddaf4 commit 5bb9e92
Show file tree
Hide file tree
Showing 272 changed files with 789 additions and 5 deletions.
3 changes: 3 additions & 0 deletions tests/language/async/await_syntax_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

// Test async/await syntax.

import 'dart:async' show Stream;
Expand Down
3 changes: 3 additions & 0 deletions tests/language/async/await_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

// VMOptions=
// VMOptions=--optimization-counter-threshold=20

Expand Down
3 changes: 3 additions & 0 deletions tests/language/async/continue_label_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

import "package:expect/async_helper.dart";
import "package:expect/expect.dart";

Expand Down
3 changes: 3 additions & 0 deletions tests/language/async/switch_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

import "dart:async";
import "package:expect/async_helper.dart";
import "package:expect/expect.dart";
Expand Down
3 changes: 3 additions & 0 deletions tests/language/async/throw_in_catch_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

import "dart:async";
import "package:expect/async_helper.dart";
import "package:expect/expect.dart";
Expand Down
3 changes: 3 additions & 0 deletions tests/language/async_star/async_star_invalid_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

// Test that various invalid uses of `yield` are disallowed.

import "dart:async";
Expand Down
3 changes: 3 additions & 0 deletions tests/language/call/method_function_typed_value_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// BSD-style license that can be found in the LICENSE file.
// Dart test program to test arithmetic operations.

// Formatting can break multitests, so don't format them.
// dart format off

import "package:expect/expect.dart";

int f(int i) => 2 * i;
Expand Down
3 changes: 3 additions & 0 deletions tests/language/call/method_implicit_tear_off_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// BSD-style license that can be found in the LICENSE file.
// Dart test program to test arithmetic operations.

// Formatting can break multitests, so don't format them.
// dart format off

import "dart:async";
import "package:expect/expect.dart";

Expand Down
3 changes: 3 additions & 0 deletions tests/language/call/method_must_not_be_field_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// BSD-style license that can be found in the LICENSE file.
// Dart test program to test arithmetic operations.

// Formatting can break multitests, so don't format them.
// dart format off

import "package:expect/expect.dart";

class C {
Expand Down
3 changes: 3 additions & 0 deletions tests/language/call/method_must_not_be_getter_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// BSD-style license that can be found in the LICENSE file.
// Dart test program to test arithmetic operations.

// Formatting can break multitests, so don't format them.
// dart format off

import "package:expect/expect.dart";

class C {
Expand Down
3 changes: 3 additions & 0 deletions tests/language/call/nonexistent_static_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

import "package:expect/expect.dart";

// When attempting to call a nonexistent static method, getter or setter, check
Expand Down
3 changes: 3 additions & 0 deletions tests/language/call/operator_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

import "package:expect/expect.dart";

// simple test with no types in signature
Expand Down
3 changes: 3 additions & 0 deletions tests/language/class/cycle2_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// BSD-style license that can be found in the LICENSE file.
// Check fail because of cycles in super class relationship.

// Formatting can break multitests, so don't format them.
// dart format off

class C extends B {}

class A extends B {}
Expand Down
3 changes: 3 additions & 0 deletions tests/language/class/cycle_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// BSD-style license that can be found in the LICENSE file.
// Check fail because of cycles in super class relationship.

// Formatting can break multitests, so don't format them.
// dart format off

import "package:expect/expect.dart";

class Foo implements Bar {}
Expand Down
3 changes: 3 additions & 0 deletions tests/language/class/literal_static_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

import "package:expect/expect.dart";

// Test class literal expressions.
Expand Down
3 changes: 3 additions & 0 deletions tests/language/class/literal_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

import "package:expect/expect.dart";

// Test class literal expressions.
Expand Down
3 changes: 3 additions & 0 deletions tests/language/class/syntax_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

main() {
new ClassSyntaxTest();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

import "package:expect/expect.dart";

typedef F1 = void Function<T>(T);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

import "package:expect/expect.dart";

// Test that 'identical(a,b)' is a compile-time constant.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

class A {
final x; //# 01: ok
//# 02: compile-time error
Expand Down
3 changes: 3 additions & 0 deletions tests/language/compile_time_constant/static4_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

class A {
final _x;
const A.a1(
Expand Down
3 changes: 3 additions & 0 deletions tests/language/compile_time_constant/static5_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

class A {
const A();
}
Expand Down
3 changes: 3 additions & 0 deletions tests/language/const/cast1_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

/// Implicit casts in constants are supported and treated as compile-time errors
/// if they are not valid.
Expand Down
3 changes: 3 additions & 0 deletions tests/language/const/cast2_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

/// Explicit casts in constants are supported and treated as compile-time errors
/// if they are not valid.
Expand Down
3 changes: 3 additions & 0 deletions tests/language/const/constructor2_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

// Regression test for issue 14348.

class A<T> {
Expand Down
3 changes: 3 additions & 0 deletions tests/language/const/double_in_int_op_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off


main() {
const dynamic i1 = 3;
Expand Down
3 changes: 3 additions & 0 deletions tests/language/const/error_multiply_initialized_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

// If a constant constructor contains an initializer, or an initializing
// formal, for a final field which itself has an initializer at its
// declaration, then a compile-time error should be reported regardless of
Expand Down
3 changes: 3 additions & 0 deletions tests/language/const/for_in_variable_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

main() {
for (
const //# 01: compile-time error
Expand Down
3 changes: 3 additions & 0 deletions tests/language/const/switch_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

import 'package:expect/expect.dart';

class C {
Expand Down
3 changes: 3 additions & 0 deletions tests/language/const/types_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

// Test handling of malformed types in constant expressions.

use(x) {}
Expand Down
3 changes: 3 additions & 0 deletions tests/language/constants_2018/const_type_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

// Tests that types do matter when an expression is evaluated as constant.

main() {
Expand Down
3 changes: 3 additions & 0 deletions tests/language/constants_2018/constant_type_literal_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

// Tests that non-deferred type literals are constant expressions.

import "dart:core";
Expand Down
3 changes: 3 additions & 0 deletions tests/language/constants_2018/constant_types_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

// Tests that in some positions only constant types are allowed, so not
// type parameters. But in other positions potentially constant types are
// allowed, including type parameters.
Expand Down
3 changes: 3 additions & 0 deletions tests/language/constants_2018/equals_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

// Tests that equality is allowed for receivers of specific types.

import "package:expect/expect.dart";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

// Tests that a dynamic type does not affect whether an expression is
// potentially constant, the actual type of the value of an expression
// only matters if the expression is evaluated as a constant.
Expand Down
3 changes: 3 additions & 0 deletions tests/language/constants_2018/potential_const_type_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

// Tests that types do not affect whether an expression is potentially
// constant, they only matter if the expression is evaluated as a constant.

Expand Down
3 changes: 3 additions & 0 deletions tests/language/constructor/duplicate_final_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

// Check that duplicate initialization of a final field is a runtime error.

class Class {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

import 'dart:core' hide dynamic;
import 'dart:core' as core show dynamic;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

// Test handling of unknown constructor in const expression.

class GoodClass {
Expand Down
3 changes: 3 additions & 0 deletions tests/language/constructor/name_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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.

// Formatting can break multitests, so don't format them.
// dart format off

class Foo {
Bar.Foo(); //# 01: compile-time error
factory Bar(); //# 02: syntax error
Expand Down
Loading

0 comments on commit 5bb9e92

Please sign in to comment.