| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library analyzer.test.generated.incremental_resolver_test; | 5 library analyzer.test.generated.incremental_resolver_test; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/dart/ast/token.dart'; | 8 import 'package:analyzer/dart/ast/token.dart'; |
| 9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
| 10 import 'package:analyzer/error/error.dart'; | 10 import 'package:analyzer/error/error.dart'; |
| (...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1004 '''); | 1004 '''); |
| 1005 _updateAndValidate( | 1005 _updateAndValidate( |
| 1006 r''' | 1006 r''' |
| 1007 class A { | 1007 class A { |
| 1008 int m() => 10 * 100; | 1008 int m() => 10 * 100; |
| 1009 } | 1009 } |
| 1010 ''', | 1010 ''', |
| 1011 expectedSuccess: false); | 1011 expectedSuccess: false); |
| 1012 } | 1012 } |
| 1013 | 1013 |
| 1014 void test_false_inBody_addAsync() { |
| 1015 _resolveUnit(r''' |
| 1016 class C { |
| 1017 test() {} |
| 1018 } |
| 1019 '''); |
| 1020 _updateAndValidate( |
| 1021 r''' |
| 1022 class C { |
| 1023 test() async {} |
| 1024 } |
| 1025 ''', |
| 1026 expectedSuccess: false); |
| 1027 } |
| 1028 |
| 1029 void test_false_inBody_async_addStar() { |
| 1030 _resolveUnit(r''' |
| 1031 import 'dart:async'; |
| 1032 class C { |
| 1033 Stream test() async {} |
| 1034 } |
| 1035 '''); |
| 1036 _updateAndValidate( |
| 1037 r''' |
| 1038 import 'dart:async'; |
| 1039 class C { |
| 1040 Stream test() async* {} |
| 1041 } |
| 1042 ''', |
| 1043 expectedSuccess: false); |
| 1044 } |
| 1045 |
| 1046 void test_false_inBody_async_removeStar() { |
| 1047 _resolveUnit(r''' |
| 1048 import 'dart:async'; |
| 1049 class C { |
| 1050 Stream test() async* {} |
| 1051 } |
| 1052 '''); |
| 1053 _updateAndValidate( |
| 1054 r''' |
| 1055 import 'dart:async'; |
| 1056 class C { |
| 1057 Stream test() async {} |
| 1058 } |
| 1059 ''', |
| 1060 expectedSuccess: false); |
| 1061 } |
| 1062 |
| 1014 void test_false_inBody_functionExpression() { | 1063 void test_false_inBody_functionExpression() { |
| 1015 _resolveUnit(r''' | 1064 _resolveUnit(r''' |
| 1016 class C extends D { | 1065 class C extends D { |
| 1017 static final f = () { | 1066 static final f = () { |
| 1018 var x = 0; | 1067 var x = 0; |
| 1019 }(); | 1068 }(); |
| 1020 } | 1069 } |
| 1021 | 1070 |
| 1022 class D {} | 1071 class D {} |
| 1023 '''); | 1072 '''); |
| 1024 _updateAndValidate( | 1073 _updateAndValidate( |
| 1025 r''' | 1074 r''' |
| 1026 class C extends D { | 1075 class C extends D { |
| 1027 static final f = () { | 1076 static final f = () { |
| 1028 var x = 01; | 1077 var x = 01; |
| 1029 }(); | 1078 }(); |
| 1030 } | 1079 } |
| 1031 | 1080 |
| 1032 class D {} | 1081 class D {} |
| 1033 ''', | 1082 ''', |
| 1034 expectedSuccess: false); | 1083 expectedSuccess: false); |
| 1035 } | 1084 } |
| 1036 | 1085 |
| 1086 void test_false_inBody_removeAsync() { |
| 1087 _resolveUnit(r''' |
| 1088 class C { |
| 1089 test() async {} |
| 1090 } |
| 1091 '''); |
| 1092 _updateAndValidate( |
| 1093 r''' |
| 1094 class C { |
| 1095 test() {} |
| 1096 } |
| 1097 ''', |
| 1098 expectedSuccess: false); |
| 1099 } |
| 1100 |
| 1101 void test_false_inBody_sync_addStar() { |
| 1102 _resolveUnit(r''' |
| 1103 class C { |
| 1104 test() {} |
| 1105 } |
| 1106 '''); |
| 1107 _updateAndValidate( |
| 1108 r''' |
| 1109 class C { |
| 1110 test() sync* {} |
| 1111 } |
| 1112 ''', |
| 1113 expectedSuccess: false); |
| 1114 } |
| 1115 |
| 1037 void test_false_topLevelFunction_name() { | 1116 void test_false_topLevelFunction_name() { |
| 1038 _resolveUnit(r''' | 1117 _resolveUnit(r''' |
| 1039 a() {} | 1118 a() {} |
| 1040 b() {} | 1119 b() {} |
| 1041 '''); | 1120 '''); |
| 1042 _updateAndValidate( | 1121 _updateAndValidate( |
| 1043 r''' | 1122 r''' |
| 1044 a() {} | 1123 a() {} |
| 1045 bb() {} | 1124 bb() {} |
| 1046 ''', | 1125 ''', |
| (...skipping 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2342 void logException(Object exception, [Object stackTrace]) { | 2421 void logException(Object exception, [Object stackTrace]) { |
| 2343 lastException = exception; | 2422 lastException = exception; |
| 2344 lastStackTrace = stackTrace; | 2423 lastStackTrace = stackTrace; |
| 2345 } | 2424 } |
| 2346 | 2425 |
| 2347 @override | 2426 @override |
| 2348 logging.LoggingTimer startTimer() { | 2427 logging.LoggingTimer startTimer() { |
| 2349 return new logging.LoggingTimer(this); | 2428 return new logging.LoggingTimer(this); |
| 2350 } | 2429 } |
| 2351 } | 2430 } |
| OLD | NEW |