mirror of
https://github.com/dart-lang/sdk
synced 2024-11-05 18:22:09 +00:00
[dart2js] Split up RTI subtype tests.
Change-Id: Id0bc61d295edfc25709aa4ff1bf9fa3c9bde5691 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107221 Reviewed-by: Stephen Adams <sra@google.com>
This commit is contained in:
parent
9b7bcfd1ce
commit
069d76a58e
1 changed files with 28 additions and 12 deletions
|
@ -31,27 +31,27 @@ main() {
|
|||
}
|
||||
|
||||
void runTests() {
|
||||
testInterfaces();
|
||||
testTopTypes();
|
||||
testNull();
|
||||
testFutureOr();
|
||||
}
|
||||
|
||||
void testInterfaces() {
|
||||
strictSubtype('List<CodeUnits>', 'Iterable<List<int>>');
|
||||
strictSubtype('CodeUnits', 'Iterable<num>');
|
||||
strictSubtype('Iterable<int>', 'Iterable<num>');
|
||||
strictSubtype('List<int>', objectName);
|
||||
strictSubtype('$futureName<int>', '$futureName<num>');
|
||||
strictSubtype('int', 'int/');
|
||||
strictSubtype('$futureName<int>', 'int/');
|
||||
strictSubtype('int/', 'num/');
|
||||
strictSubtype('int', 'num/');
|
||||
strictSubtype('$futureName<int>', 'num/');
|
||||
strictSubtype(nullName, 'int');
|
||||
strictSubtype(nullName, 'Iterable<CodeUnits>');
|
||||
strictSubtype(nullName, objectName);
|
||||
unrelated('int', 'CodeUnits');
|
||||
equivalent(nullName, nullName);
|
||||
equivalent('double', 'double');
|
||||
equivalent('List<int>', 'List<int>');
|
||||
}
|
||||
|
||||
void testTopTypes() {
|
||||
strictSubtype('List<int>', objectName);
|
||||
equivalent(objectName, objectName);
|
||||
equivalent('@', '@');
|
||||
equivalent('~', '~');
|
||||
equivalent('1&', '1&');
|
||||
equivalent('List<int>', 'List<int>');
|
||||
equivalent(objectName, '@');
|
||||
equivalent(objectName, '~');
|
||||
equivalent(objectName, '1&');
|
||||
|
@ -64,6 +64,22 @@ void runTests() {
|
|||
equivalent('List<@>', 'List<~>');
|
||||
equivalent('List<@>', 'List<1&>');
|
||||
equivalent('List<~>', 'List<1&>');
|
||||
}
|
||||
|
||||
void testNull() {
|
||||
strictSubtype(nullName, 'int');
|
||||
strictSubtype(nullName, 'Iterable<CodeUnits>');
|
||||
strictSubtype(nullName, objectName);
|
||||
equivalent(nullName, nullName);
|
||||
}
|
||||
|
||||
void testFutureOr() {
|
||||
strictSubtype('$futureName<int>', '$futureName<num>');
|
||||
strictSubtype('int', 'int/');
|
||||
strictSubtype('$futureName<int>', 'int/');
|
||||
strictSubtype('int/', 'num/');
|
||||
strictSubtype('int', 'num/');
|
||||
strictSubtype('$futureName<int>', 'num/');
|
||||
equivalent('@/', '~/');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue