| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 test.src.task.dart_test; | 5 library test.src.task.dart_test; |
| 6 | 6 |
| 7 import 'package:analyzer/file_system/file_system.dart'; | 7 import 'package:analyzer/file_system/file_system.dart'; |
| 8 import 'package:analyzer/file_system/memory_file_system.dart'; | 8 import 'package:analyzer/file_system/memory_file_system.dart'; |
| 9 import 'package:analyzer/src/context/cache.dart'; | 9 import 'package:analyzer/src/context/cache.dart'; |
| 10 import 'package:analyzer/src/generated/ast.dart'; | 10 import 'package:analyzer/src/generated/ast.dart'; |
| (...skipping 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1130 '''); | 1130 '''); |
| 1131 LibraryUnitTarget target = new LibraryUnitTarget(source, source); | 1131 LibraryUnitTarget target = new LibraryUnitTarget(source, source); |
| 1132 _computeResult(target, HINTS); | 1132 _computeResult(target, HINTS); |
| 1133 expect(task, new isInstanceOf<GenerateHintsTask>()); | 1133 expect(task, new isInstanceOf<GenerateHintsTask>()); |
| 1134 // validate | 1134 // validate |
| 1135 _fillErrorListener(HINTS); | 1135 _fillErrorListener(HINTS); |
| 1136 errorListener.assertErrorsWithCodes(<ErrorCode>[HintCode.MISSING_RETURN]); | 1136 errorListener.assertErrorsWithCodes(<ErrorCode>[HintCode.MISSING_RETURN]); |
| 1137 } | 1137 } |
| 1138 | 1138 |
| 1139 test_perform_dart2js() { | 1139 test_perform_dart2js() { |
| 1140 // TODO(scheglov) There is a bug - we need to finish building | 1140 Source source = _newSource('/test.dart', ''' |
| 1141 // TypeProvider hierarchies before validating "expr is CoreType". | 1141 main(p) { |
| 1142 // Source source = _newSource('/test.dart', ''' | 1142 if (p is double) { |
| 1143 //main(p) { | 1143 print('double'); |
| 1144 // if (p is double) { | 1144 } |
| 1145 // print('double'); | 1145 } |
| 1146 // } | 1146 '''); |
| 1147 //} | 1147 LibraryUnitTarget target = new LibraryUnitTarget(source, source); |
| 1148 //'''); | 1148 _computeResult(target, HINTS); |
| 1149 // LibraryUnitTarget target = new LibraryUnitTarget(source, source); | 1149 expect(task, new isInstanceOf<GenerateHintsTask>()); |
| 1150 // _computeResult(target, HINTS); | 1150 // validate |
| 1151 // expect(task, new isInstanceOf<GenerateHintsTask>()); | 1151 _fillErrorListener(HINTS); |
| 1152 // // validate | 1152 errorListener.assertErrorsWithCodes(<ErrorCode>[HintCode.IS_DOUBLE]); |
| 1153 // _fillErrorListener(HINTS); | |
| 1154 // errorListener.assertErrorsWithCodes(<ErrorCode>[HintCode.IS_DOUBLE]); | |
| 1155 } | 1153 } |
| 1156 | 1154 |
| 1157 test_perform_deadCode() { | 1155 test_perform_deadCode() { |
| 1158 Source source = _newSource('/test.dart', ''' | 1156 Source source = _newSource('/test.dart', ''' |
| 1159 main() { | 1157 main() { |
| 1160 if (false) { | 1158 if (false) { |
| 1161 print('how?'); | 1159 print('how?'); |
| 1162 } | 1160 } |
| 1163 } | 1161 } |
| 1164 '''); | 1162 '''); |
| (...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1723 return entryMap.putIfAbsent(target, () => new CacheEntry()); | 1721 return entryMap.putIfAbsent(target, () => new CacheEntry()); |
| 1724 } | 1722 } |
| 1725 | 1723 |
| 1726 TimestampedData<String> getContents(Source source) => source.contents; | 1724 TimestampedData<String> getContents(Source source) => source.contents; |
| 1727 | 1725 |
| 1728 noSuchMethod(Invocation invocation) { | 1726 noSuchMethod(Invocation invocation) { |
| 1729 print('noSuchMethod: ${invocation.memberName}'); | 1727 print('noSuchMethod: ${invocation.memberName}'); |
| 1730 return super.noSuchMethod(invocation); | 1728 return super.noSuchMethod(invocation); |
| 1731 } | 1729 } |
| 1732 } | 1730 } |
| OLD | NEW |