Files
sdk/pkg/front_end/testcases
Erik Ernst 5ecbd3acc2 Fix the error_test failures
This CL adjusts the CFE handling of errors such that error_test.dart
succeeds: It changes the placement of the error about "wrong parameter
type" such that it is reported on the type annotation and not on the
parameter's name. Next, it adds some extra checks such that it is
enforced that the parameter of an anonymous method must be positional
and mandatory.

Change-Id: I56851d94c9fd975e117c17f671d684f155a28847
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/498021
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-04-27 01:31:31 -07:00
..
2026-04-27 01:31:31 -07:00

Overview

The testcases in this directory and its subdirectory are all compiled in various different configurations designed to test various aspects of Fasta (or more generally, package:front_end).

The configurations are described below.

The source of truth for these configurations is the file pkg/front_end/testing.json.

Updating all expectations

To update test expectations for all tests at once, run:

dart pkg/front_end/tool/update_expectations.dart

Note that this takes a long time and should only be used when many tests need updating.

Updating expectations for a single test

To update the expectations for a specific test, provide the folder and test name as an argument.

For example, if you want to update the test expectations for a test, such as pkg/front_end/testcases/general/abstract_instantiation.dart, then run:

dart pkg/front_end/tool/update_expectations.dart general/abstract_instantiation

Updating expectations for all tests in a folder

If you want to update the test expectations for a specific folder of tests such as the pkg/front_end/testcases/general/ folder, then run:

dart pkg/front_end/tool/update_expectations.dart general/...

Dart 3.0 Outlines

./pkg/front_end/tool/cfe testing -DupdateExpectations=true outline/test1 outline/test2 ...

Dart 3.0 (strong mode)

./pkg/front_end/tool/cfe testing -DupdateExpectations=true -DupdateComments=true strong/test1 strong/test2 ...

Note: strong mode configuration additionally parses comments in the test file and can precisely match internal details of the compiler such as the inferred type of an expression or if a warning was emitted at a given location.