dart-sdk/tests/language/this
Sigmund Cherem 050afd650f [expect] introduce Expect.throwsWhen and Expect.throwsTypeErrorWhen
Today, most tests that touch on a behavior variation end up
skipping expectations or the entirety of a test for some
testing configurations.  Moving forward, we'd like skip less
and try to account for the behavior variations if that's
reasonable.

This CL shows an approach to improve our test coverage for
behavior variations. We introduce two new methods to
[Expect] that allow us to conditionally check that a
function throws, depending on variation predicates.

The CL changes expectations for errors that don't occur
when dart2js omits parameter type checks or implicit
downcasts.

Note: originally I had the intention to introduce a name
parameter to `Expect.throws` and `Expect.throwsTypeError` to
avoid introducing a new API. However, because these APIs are
used for testing core language features, such as function
parameters themselves, we decided to keep the use of
features in these APIs as simple as it can be.

CoreLibraryReviewExempt: no public library semantic change - only improving test coverage under variations
Change-Id: I531657622655778491eaca8b37ba69ffaab559fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351340
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2024-02-14 20:12:05 +00:00
..
as_covariant_call_checks_test.dart [expect] introduce Expect.throwsWhen and Expect.throwsTypeErrorWhen 2024-02-14 20:12:05 +00:00
as_dynamic_call_checks_test.dart Remove uses of : as default value separator in some tests/ directories. 2022-09-07 14:49:17 +00:00
call_this_test.dart
conditional_operator_runtime_test.dart [cfe] Warn on null aware access on this and static members 2020-10-15 08:48:33 +00:00
conditional_operator_test.dart Analyzer: do not report an undefined getter with an empty name 2020-12-05 14:39:03 +00:00
implicit_runtime_test.dart
implicit_this_test.dart
in_initializer_test.dart
runtime_test.dart
this_test.dart