[tests] Make corelib/string_split_test conditional rather than multitest

corelib/string_split_test/checkedstore goes away.

Change-Id: I00ad3d42ef2c9798c2a76c6e8ca568954cb1e9f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333643
Reviewed-by: Kallen Tu <kallentu@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
This commit is contained in:
Stephen Adams 2023-11-03 17:28:08 +00:00 committed by Commit Queue
parent 9fa33d8acd
commit 4bc730b18b

View file

@ -24,10 +24,12 @@ testSplit(List<String> expect, String string, Pattern pattern) {
// Ensure that the correct type is reified.
actual = actual as List<String>;
// Check that store of the wrong type throws. Some platforms don't do this,
// so it's protected by multitest syntax.
Expect.throwsTypeError(() => actual.add(42), // //# checkedstore: ok
'List<String>.add should not accept an int'); // //# checkedstore: ok
// Check that store of the wrong type throws. Don't test on configurations
// that don't perform type checks.
if (!dart2jsProductionMode) {
Expect.throwsTypeError(() => actual.add(42),
'List<String>.add should not accept an int');
}
Expect.listEquals(expect, actual, '"$string".split($patternString)');
}