Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: pkg/analyzer/test/context/declared_variables_test.dart

Issue 2391423003: Switch 'analyzer' to 'package:test' and test_reflective_loader ^0.1.0. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/test.dart';
11 import 'package:test_reflective_loader/test_reflective_loader.dart'; 12 import 'package:test_reflective_loader/test_reflective_loader.dart';
12 import 'package:unittest/unittest.dart';
13 13
14 import '../generated/test_support.dart'; 14 import '../generated/test_support.dart';
15 import '../utils.dart'; 15 import '../utils.dart';
16 16
17 main() { 17 main() {
18 initializeTestEnvironment(); 18 initializeTestEnvironment();
19 defineReflectiveTests(DeclaredVariablesTest); 19 defineReflectiveSuite(() {
20 defineReflectiveTests(DeclaredVariablesTest);
21 });
20 } 22 }
21 23
22 @reflectiveTest 24 @reflectiveTest
23 class DeclaredVariablesTest extends EngineTestCase { 25 class DeclaredVariablesTest extends EngineTestCase {
24 void test_getBool_false() { 26 void test_getBool_false() {
25 TestTypeProvider typeProvider = new TestTypeProvider(); 27 TestTypeProvider typeProvider = new TestTypeProvider();
26 String variableName = "var"; 28 String variableName = "var";
27 DeclaredVariables variables = new DeclaredVariables(); 29 DeclaredVariables variables = new DeclaredVariables();
28 variables.define(variableName, "false"); 30 variables.define(variableName, "false");
29 DartObject object = variables.getBool(typeProvider, variableName); 31 DartObject object = variables.getBool(typeProvider, variableName);
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 void _assertNullDartObject(TestTypeProvider typeProvider, DartObject result) { 109 void _assertNullDartObject(TestTypeProvider typeProvider, DartObject result) {
108 expect(result.type, typeProvider.nullType); 110 expect(result.type, typeProvider.nullType);
109 } 111 }
110 112
111 void _assertUnknownDartObject( 113 void _assertUnknownDartObject(
112 ParameterizedType expectedType, DartObject result) { 114 ParameterizedType expectedType, DartObject result) {
113 expect((result as DartObjectImpl).isUnknown, isTrue); 115 expect((result as DartObjectImpl).isUnknown, isTrue);
114 expect(result.type, expectedType); 116 expect(result.type, expectedType);
115 } 117 }
116 } 118 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698