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 engine.all_the_rest_test; | 5 library engine.all_the_rest_test; |
6 | 6 |
7 import 'package:analyzer/file_system/physical_file_system.dart'; | 7 import 'package:analyzer/file_system/physical_file_system.dart'; |
8 import 'package:analyzer/src/generated/ast.dart' hide ConstantEvaluator; | 8 import 'package:analyzer/src/generated/ast.dart' hide ConstantEvaluator; |
9 import 'package:analyzer/src/generated/constant.dart'; | 9 import 'package:analyzer/src/generated/constant.dart'; |
10 import 'package:analyzer/src/generated/element.dart'; | 10 import 'package:analyzer/src/generated/element.dart'; |
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
879 @reflectiveTest | 879 @reflectiveTest |
880 class ConstantFinderTest extends EngineTestCase { | 880 class ConstantFinderTest extends EngineTestCase { |
881 AstNode _node; | 881 AstNode _node; |
882 TypeProvider _typeProvider; | 882 TypeProvider _typeProvider; |
883 AnalysisContext _context; | 883 AnalysisContext _context; |
884 Source _source; | 884 Source _source; |
885 | 885 |
886 void setUp() { | 886 void setUp() { |
887 super.setUp(); | 887 super.setUp(); |
888 _typeProvider = new TestTypeProvider(); | 888 _typeProvider = new TestTypeProvider(); |
889 _context = new TestAnalysisContext(); | 889 _context = new TestAnalysisContext_ConstantFinderTest(); |
890 _source = new TestSource(); | 890 _source = new TestSource(); |
891 } | 891 } |
892 | 892 |
893 /** | 893 /** |
894 * Test an annotation that consists solely of an identifier (and hence | 894 * Test an annotation that consists solely of an identifier (and hence |
895 * represents a reference to a compile-time constant variable). | 895 * represents a reference to a compile-time constant variable). |
896 */ | 896 */ |
897 void test_visitAnnotation_constantVariable() { | 897 void test_visitAnnotation_constantVariable() { |
898 _node = AstFactory.annotation(AstFactory.identifier3('x')); | 898 _node = AstFactory.annotation(AstFactory.identifier3('x')); |
899 expect(_findAnnotations(), contains(_node)); | 899 expect(_findAnnotations(), contains(_node)); |
(...skipping 8161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9061 } | 9061 } |
9062 | 9062 |
9063 @reflectiveTest | 9063 @reflectiveTest |
9064 class StringScannerTest extends AbstractScannerTest { | 9064 class StringScannerTest extends AbstractScannerTest { |
9065 @override | 9065 @override |
9066 ht.AbstractScanner newScanner(String input) { | 9066 ht.AbstractScanner newScanner(String input) { |
9067 return new ht.StringScanner(null, input); | 9067 return new ht.StringScanner(null, input); |
9068 } | 9068 } |
9069 } | 9069 } |
9070 | 9070 |
| 9071 class TestAnalysisContext_ConstantFinderTest extends TestAnalysisContext { |
| 9072 bool invoked = false; |
| 9073 TestAnalysisContext_ConstantFinderTest(); |
| 9074 |
| 9075 @override |
| 9076 InternalAnalysisContext getContextFor(Source source) { |
| 9077 return this; |
| 9078 } |
| 9079 } |
| 9080 |
9071 /** | 9081 /** |
9072 * Instances of the class `ToSourceVisitorTest` | 9082 * Instances of the class `ToSourceVisitorTest` |
9073 */ | 9083 */ |
9074 @reflectiveTest | 9084 @reflectiveTest |
9075 class ToSourceVisitorTest extends EngineTestCase { | 9085 class ToSourceVisitorTest extends EngineTestCase { |
9076 void fail_visitHtmlScriptTagNode_attributes_content() { | 9086 void fail_visitHtmlScriptTagNode_attributes_content() { |
9077 _assertSource( | 9087 _assertSource( |
9078 "<script type='application/dart'>f() {}</script>", | 9088 "<script type='application/dart'>f() {}</script>", |
9079 HtmlFactory.scriptTagWithContent( | 9089 HtmlFactory.scriptTagWithContent( |
9080 "f() {}", [HtmlFactory.attribute("type", "'application/dart'")])); | 9090 "f() {}", [HtmlFactory.attribute("type", "'application/dart'")])); |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9413 if (_expectedExternalScriptName == null) { | 9423 if (_expectedExternalScriptName == null) { |
9414 expect(scriptSource, isNull, reason: "script $scriptIndex"); | 9424 expect(scriptSource, isNull, reason: "script $scriptIndex"); |
9415 } else { | 9425 } else { |
9416 expect(scriptSource, isNotNull, reason: "script $scriptIndex"); | 9426 expect(scriptSource, isNotNull, reason: "script $scriptIndex"); |
9417 String actualExternalScriptName = scriptSource.shortName; | 9427 String actualExternalScriptName = scriptSource.shortName; |
9418 expect(actualExternalScriptName, _expectedExternalScriptName, | 9428 expect(actualExternalScriptName, _expectedExternalScriptName, |
9419 reason: "script $scriptIndex"); | 9429 reason: "script $scriptIndex"); |
9420 } | 9430 } |
9421 } | 9431 } |
9422 } | 9432 } |
OLD | NEW |