OLD | NEW |
---|---|
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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.utils; | 5 library analyzer.test.utils; |
6 | 6 |
7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
8 import 'package:analyzer/dart/element/element.dart'; | 8 import 'package:analyzer/dart/element/element.dart'; |
9 import 'package:analyzer/dart/element/type.dart'; | 9 import 'package:analyzer/dart/element/type.dart'; |
10 import 'package:analyzer/src/generated/resolver.dart' show TypeProvider; | 10 import 'package:analyzer/src/generated/resolver.dart' show TypeProvider; |
11 import 'package:path/path.dart' as path; | 11 import 'package:path/path.dart' as path; |
12 import 'package:unittest/unittest.dart'; | 12 import 'package:test/test.dart'; |
13 | 13 |
14 void initializeTestEnvironment([path.Context context]) { | 14 void initializeTestEnvironment([path.Context context]) {} |
Paul Berry
2016/10/06 03:01:03
Since this function doesn't do anything anymore, c
| |
15 groupSep = ' | '; | |
16 } | |
17 | 15 |
18 /** | 16 /** |
19 * The type of an assertion which asserts properties of [T]s. | 17 * The type of an assertion which asserts properties of [T]s. |
20 */ | 18 */ |
21 typedef void Asserter<T>(T type); | 19 typedef void Asserter<T>(T type); |
22 | 20 |
23 /** | 21 /** |
24 * The type of a function which given an [S], builds an assertion over [T]s. | 22 * The type of a function which given an [S], builds an assertion over [T]s. |
25 */ | 23 */ |
26 typedef Asserter<T> AsserterBuilder<S, T>(S arg); | 24 typedef Asserter<T> AsserterBuilder<S, T>(S arg); |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
293 Asserter<DartType> isType(DartType argument) => (DartType t) { | 291 Asserter<DartType> isType(DartType argument) => (DartType t) { |
294 expect(t, same(argument)); | 292 expect(t, same(argument)); |
295 }; | 293 }; |
296 | 294 |
297 /** | 295 /** |
298 * Given a type, produce an assertion that a type has the same element. | 296 * Given a type, produce an assertion that a type has the same element. |
299 */ | 297 */ |
300 Asserter<DartType> sameElement(DartType elementType) => | 298 Asserter<DartType> sameElement(DartType elementType) => |
301 hasElement(elementType.element); | 299 hasElement(elementType.element); |
302 } | 300 } |
OLD | NEW |