dart-sdk/tests/language/covariant
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
..
callable_class_field_getter_test.dart Add language test to reproduce #53089. 2023-08-02 12:02:38 +00:00
covariant_test.dart
field_test.dart [expect] introduce Expect.throwsWhen and Expect.throwsTypeErrorWhen 2024-02-14 20:12:05 +00:00
method_test.dart [expect] introduce Expect.throwsWhen and Expect.throwsTypeErrorWhen 2024-02-14 20:12:05 +00:00
override_covariant_both_test.dart Add tests about covariant parameters and inherited methods 2021-09-01 23:47:47 +00:00
override_covariant_class_test.dart Add tests about covariant parameters and inherited methods 2021-09-01 23:47:47 +00:00
override_covariant_interface_test.dart Add tests about covariant parameters and inherited methods 2021-09-01 23:47:47 +00:00
override_covariant_superclass_test.dart Add tests about covariant parameters and inherited methods 2021-09-01 23:47:47 +00:00
override_test.dart
return_type_test.dart Move codes from StaticTypeWarningCode into CompileTimeErrorCode. 2020-07-27 16:44:15 +00:00
setter_test.dart update covariant setter test to test mixin class behavior also 2023-03-17 17:38:49 +00:00
subtyping_tearoff1_test.dart
subtyping_tearoff2_test.dart
subtyping_tearoff3_test.dart
subtyping_test.dart Clean up a number of 2.19 opt outs in language tests. 2023-03-17 16:17:50 +00:00
subtyping_unsafe_call1_test.dart
subtyping_unsafe_call2_test.dart
subtyping_unsafe_call3_test.dart
subtyping_with_mixin_test.dart Clean up a number of 2.19 opt outs in language tests. 2023-03-17 16:17:50 +00:00
tear_off_type_test.dart
type_parameter_test.dart Adjust type_parameter_test to expect caller-side check on tearoff 2021-08-11 16:37:51 +00:00