Commit Graph

8 Commits

Author SHA1 Message Date
Erik Ernst 0fcdc08e60 Change language tests to avoid unintended syntax errors
The new feature 'declaring constructors' will change the syntax such
that it is an error for a non-declaring formal parameter declaration
to have the modifier `final`, and it is an error to use `var` as a
replacement for a type annotation (but the type annotation can still
be omitted entirely). This CL removes those modifiers such that the
tests will not start failing on things that aren't errors any more.

Change-Id: Ie6628f66eca696b28900759d8234b814033b4027
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/456740
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2025-10-27 01:35:09 -07:00
Robert Nystrom c9d54c12f6 Reformat tests/language/s** using 3.8 style.
Change-Id: I3c5cfbc1bc5e41d2ef1598427067dea00f9f42b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425403
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2025-05-02 04:46:00 -07:00
Robert Nystrom 5bb9e922db Opt multitests out of formatting in language/.
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 <rnystrom@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2024-11-21 10:49:44 +00:00
William Hesse d6c9c9f8bf [test] Convert syntax_native_test to a static error test
Multitests of compile-time errors should be converted to static
error tests, so they don't run on runtime configurations.
Static error tests also test for all the static errors,
their positions, and error message, in a single test run.

This test is currently failing on the common front end,
and on all runtimes, and passing on the analyzer. The
change keeps the failure on common front end by adding
expectations for an error to be reported at the right places.

Bug: https://github.com/dart-lang/sdk/issues/54153
Change-Id: Ic64961f6e0e575ec60626d4f70a0fdc5d71d024e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363085
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2024-04-23 23:11:17 +00:00
Sergey G. Grekhov 82b78916fd [tests] Remove obsolete Dart 3.0 experiments from language tests
Change-Id: If31c487e3ebe2c1ae847aff7c8994580b8b6f2f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309660
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-06-15 08:26:27 +00:00
Johnni Winther e77907f755 [test] Extract test for "native"
This move the test of the "native" syntax, support by the CFE, to
a separate test. The test (expecting the syntax to _not_ be supported)
fails on the CFE but that has nothing to with the records/patterns
features which the remaining tests in syntax_test.dart require.

Change-Id: Idef0d8b58b24488bcd4e3318eac9638152056b2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280111
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-02-01 10:06:37 +00:00
Erik Ernst 3b74c305fd Update syntax_test to avoid expecting new syntax to be a syntax error
New language features made `futureOr(null) = 1` a syntactically
correct pattern assignment, so it should not be expected to cause a
syntax error. This CL changes that test case such that it is still an
assignment to a syntactically correct function invocation, but not a
correct pattern assignment (so it's again a syntax error).

Added more tests with similar properties: The 3.0 grammar causes some
test cases to be wrong, and this CL makes changes such that they will
continue to test "the same thing" as far as possible in the new
language.

Change-Id: Ie0166f1a599ffeebfd352f4fadc01abc0950bd0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279169
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2023-01-19 14:44:36 +00:00
Robert Nystrom 9982f711db Migrate language_2/syntax to NNBD.
Change-Id: Id72071d398e1d727f4bf5f073e574a701ab639f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151624
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2020-06-18 22:54:13 +00:00