| Index: tests/compiler/dart2js/return_type_inferer_test.dart
|
| diff --git a/tests/compiler/dart2js/call_site_type_inferer_static_test.dart b/tests/compiler/dart2js/return_type_inferer_test.dart
|
| similarity index 73%
|
| copy from tests/compiler/dart2js/call_site_type_inferer_static_test.dart
|
| copy to tests/compiler/dart2js/return_type_inferer_test.dart
|
| index 3a3a7dd85915788b740f4368b19b576e9d6d58f5..cc83fb1cd45c592bdfd3572dacefa87c9119ae94 100644
|
| --- a/tests/compiler/dart2js/call_site_type_inferer_static_test.dart
|
| +++ b/tests/compiler/dart2js/return_type_inferer_test.dart
|
| @@ -70,30 +70,26 @@ final String TEST_TEN = @"""
|
| main() { f(1); g(f); }
|
| """;
|
|
|
| -void runTest(String test, [List<HType> expectedTypes = null]) {
|
| +void runTest(String test, [HType expectedType = HType.UNKNOWN]) {
|
| compileAndFind(
|
| test,
|
| 'f',
|
| (backend, x) {
|
| - List<HType> types =
|
| - backend.optimisticParameterTypesWithRecompilationOnTypeChange(x);
|
| - if (expectedTypes != null) {
|
| - Expect.listEquals(expectedTypes, types);
|
| - } else {
|
| - Expect.isNull(types);
|
| - }
|
| + HType type =
|
| + backend.optimisticReturnTypesWithRecompilationOnTypeChange(null, x);
|
| + Expect.equals(expectedType, type);
|
| });
|
| }
|
|
|
| void test() {
|
| - runTest(TEST_ONE, [HType.STRING]);
|
| - runTest(TEST_TWO, [HType.INTEGER]);
|
| - runTest(TEST_THREE, [HType.INTEGER]);
|
| - runTest(TEST_FOUR, [HType.DOUBLE]);
|
| - runTest(TEST_FIVE, [HType.NUMBER]);
|
| - runTest(TEST_SIX, [HType.NUMBER]);
|
| + runTest(TEST_ONE, HType.STRING);
|
| + runTest(TEST_TWO, HType.INTEGER);
|
| + runTest(TEST_THREE, HType.INTEGER);
|
| + runTest(TEST_FOUR, HType.DOUBLE);
|
| + runTest(TEST_FIVE, HType.NUMBER);
|
| + runTest(TEST_SIX, HType.NUMBER);
|
| runTest(TEST_SEVEN);
|
| - runTest(TEST_EIGHT, [HType.INTEGER, HType.UNKNOWN]);
|
| + runTest(TEST_EIGHT, HType.INTEGER);
|
| runTest(TEST_NINE);
|
| runTest(TEST_TEN);
|
| }
|
|
|