| Index: pkg/analyzer/test/utils.dart
|
| diff --git a/pkg/analyzer/test/utils.dart b/pkg/analyzer/test/utils.dart
|
| index a8ed5e7c5af271a5e792d678da4fb04af9567b3d..6d70357280673cd487f00fe20b1759a01c3e24be 100644
|
| --- a/pkg/analyzer/test/utils.dart
|
| +++ b/pkg/analyzer/test/utils.dart
|
| @@ -221,12 +221,12 @@ class TypeAssertions {
|
| /**
|
| * Primitive assertion for the list type
|
| */
|
| - Asserter<DartType> get isList => sameElement(_typeProvider.listType);
|
| + Asserter<DartType> get isList => hasElementOf(_typeProvider.listType);
|
|
|
| /**
|
| * Primitive assertion for the map type
|
| */
|
| - Asserter<DartType> get isMap => sameElement(_typeProvider.mapType);
|
| + Asserter<DartType> get isMap => hasElementOf(_typeProvider.mapType);
|
|
|
| /**
|
| * Primitive assertion for the num type
|
| @@ -239,10 +239,16 @@ class TypeAssertions {
|
| Asserter<DartType> get isString => isType(_typeProvider.stringType);
|
|
|
| /**
|
| - * Given a type, produce an assertion that a type has the same element.
|
| + * Assert that a type has the element that is equal to the [expected].
|
| */
|
| - Asserter<DartType> hasElement(Element element) =>
|
| - (DartType type) => expect(element, same(type.element));
|
| + Asserter<DartType> hasElement(Element expected) =>
|
| + (DartType type) => expect(expected, type.element);
|
| +
|
| + /**
|
| + * Assert that a type has the element that is equal to the element of the
|
| + * given [type].
|
| + */
|
| + Asserter<DartType> hasElementOf(DartType type) => hasElement(type.element);
|
|
|
| /**
|
| * Given assertions for the argument and return types, produce an
|
| @@ -258,7 +264,7 @@ class TypeAssertions {
|
|
|
| /**
|
| * Given an assertion for the base type and assertions over the type
|
| - * parameters, produce an assertion over instantations.
|
| + * parameters, produce an assertion over instantiations.
|
| */
|
| AsserterBuilder<List<Asserter<DartType>>, DartType> isInstantiationOf(
|
| Asserter<DartType> baseAssert) =>
|
| @@ -288,15 +294,9 @@ class TypeAssertions {
|
| isInstantiationOf(isMap)([argAssert0, argAssert1]);
|
|
|
| /**
|
| - * Assert that one type is the same as another
|
| + * Assert that a type is equal to the [expected].
|
| */
|
| - Asserter<DartType> isType(DartType argument) => (DartType t) {
|
| - expect(t, same(argument));
|
| + Asserter<DartType> isType(DartType expected) => (DartType t) {
|
| + expect(t, expected);
|
| };
|
| -
|
| - /**
|
| - * Given a type, produce an assertion that a type has the same element.
|
| - */
|
| - Asserter<DartType> sameElement(DartType elementType) =>
|
| - hasElement(elementType.element);
|
| }
|
|
|