OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.context.declared_variables_test; | 5 library analyzer.test.context.declared_variables_test; |
6 | 6 |
7 import 'package:analyzer/context/declared_variables.dart'; | 7 import 'package:analyzer/context/declared_variables.dart'; |
8 import 'package:analyzer/dart/element/type.dart'; | 8 import 'package:analyzer/dart/element/type.dart'; |
9 import 'package:analyzer/src/generated/constant.dart'; | 9 import 'package:analyzer/src/generated/constant.dart'; |
10 import 'package:analyzer/src/generated/testing/test_type_provider.dart'; | 10 import 'package:analyzer/src/generated/testing/test_type_provider.dart'; |
| 11 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
11 import 'package:unittest/unittest.dart'; | 12 import 'package:unittest/unittest.dart'; |
12 | 13 |
13 import '../generated/test_support.dart'; | 14 import '../generated/test_support.dart'; |
14 import '../reflective_tests.dart'; | |
15 import '../utils.dart'; | 15 import '../utils.dart'; |
16 | 16 |
17 main() { | 17 main() { |
18 initializeTestEnvironment(); | 18 initializeTestEnvironment(); |
19 runReflectiveTests(DeclaredVariablesTest); | 19 defineReflectiveTests(DeclaredVariablesTest); |
20 } | 20 } |
21 | 21 |
22 @reflectiveTest | 22 @reflectiveTest |
23 class DeclaredVariablesTest extends EngineTestCase { | 23 class DeclaredVariablesTest extends EngineTestCase { |
24 void test_getBool_false() { | 24 void test_getBool_false() { |
25 TestTypeProvider typeProvider = new TestTypeProvider(); | 25 TestTypeProvider typeProvider = new TestTypeProvider(); |
26 String variableName = "var"; | 26 String variableName = "var"; |
27 DeclaredVariables variables = new DeclaredVariables(); | 27 DeclaredVariables variables = new DeclaredVariables(); |
28 variables.define(variableName, "false"); | 28 variables.define(variableName, "false"); |
29 DartObject object = variables.getBool(typeProvider, variableName); | 29 DartObject object = variables.getBool(typeProvider, variableName); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 void _assertNullDartObject(TestTypeProvider typeProvider, DartObject result) { | 107 void _assertNullDartObject(TestTypeProvider typeProvider, DartObject result) { |
108 expect(result.type, typeProvider.nullType); | 108 expect(result.type, typeProvider.nullType); |
109 } | 109 } |
110 | 110 |
111 void _assertUnknownDartObject( | 111 void _assertUnknownDartObject( |
112 ParameterizedType expectedType, DartObject result) { | 112 ParameterizedType expectedType, DartObject result) { |
113 expect((result as DartObjectImpl).isUnknown, isTrue); | 113 expect((result as DartObjectImpl).isUnknown, isTrue); |
114 expect(result.type, expectedType); | 114 expect(result.type, expectedType); |
115 } | 115 } |
116 } | 116 } |
OLD | NEW |