Chromium Code Reviews| 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/java_io.dart'; | 10 import 'package:analyzer/src/generated/java_io.dart'; |
| 11 import 'package:analyzer/src/generated/resolver.dart' show TypeProvider; | 11 import 'package:analyzer/src/generated/resolver.dart' show TypeProvider; |
| 12 import 'package:path/path.dart' as path; | 12 import 'package:path/path.dart' as path; |
| 13 import 'package:unittest/unittest.dart'; | 13 import 'package:unittest/unittest.dart'; |
| 14 | 14 |
| 15 void initializeTestEnvironment() { | 15 void initializeTestEnvironment([path.Context context]) { |
| 16 groupSep = ' | '; | 16 groupSep = ' | '; |
| 17 JavaFile.pathContext = path.posix; | 17 JavaFile.pathContext = context ?? path.posix; |
|
danrubel
2016/01/22 19:26:38
Ultimately, we need to remove the line above... bu
| |
| 18 } | 18 } |
| 19 | 19 |
| 20 /** | 20 /** |
| 21 * The type of an assertion which asserts properties of [T]s. | 21 * The type of an assertion which asserts properties of [T]s. |
| 22 */ | 22 */ |
| 23 typedef void Asserter<T>(T type); | 23 typedef void Asserter<T>(T type); |
| 24 | 24 |
| 25 /** | 25 /** |
| 26 * The type of a function which given an [S], builds an assertion over [T]s. | 26 * The type of a function which given an [S], builds an assertion over [T]s. |
| 27 */ | 27 */ |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 295 Asserter<DartType> isType(DartType argument) => (DartType t) { | 295 Asserter<DartType> isType(DartType argument) => (DartType t) { |
| 296 expect(t, same(argument)); | 296 expect(t, same(argument)); |
| 297 }; | 297 }; |
| 298 | 298 |
| 299 /** | 299 /** |
| 300 * Given a type, produce an assertion that a type has the same element. | 300 * Given a type, produce an assertion that a type has the same element. |
| 301 */ | 301 */ |
| 302 Asserter<DartType> sameElement(DartType elementType) => | 302 Asserter<DartType> sameElement(DartType elementType) => |
| 303 hasElement(elementType.element); | 303 hasElement(elementType.element); |
| 304 } | 304 } |
| OLD | NEW |