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

Unified Diff: pkg/analyzer_experimental/test/generated/element_test.dart

Issue 23080005: New analysis_experimental snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer_experimental/test/generated/element_test.dart
diff --git a/pkg/analyzer_experimental/test/generated/element_test.dart b/pkg/analyzer_experimental/test/generated/element_test.dart
index c5d24f1d1cac6709d98d9d307731216c163b23ee..627c7c3db99f932e3cbcd3db572591d43cebe7bd 100644
--- a/pkg/analyzer_experimental/test/generated/element_test.dart
+++ b/pkg/analyzer_experimental/test/generated/element_test.dart
@@ -1619,6 +1619,16 @@ class InterfaceTypeImplTest extends EngineTestCase {
}
}
class TypeVariableTypeImplTest extends EngineTestCase {
+ void fail_isMoreSpecificThan_typeArguments_object() {
+ TypeVariableElementImpl element = new TypeVariableElementImpl(ASTFactory.identifier3("E"));
+ TypeVariableTypeImpl type = new TypeVariableTypeImpl(element);
+ JUnitTestCase.assertTrue(type.isMoreSpecificThan(ElementFactory.object.type));
+ }
+ void fail_isMoreSpecificThan_typeArguments_self() {
+ TypeVariableElementImpl element = new TypeVariableElementImpl(ASTFactory.identifier3("E"));
+ TypeVariableTypeImpl type = new TypeVariableTypeImpl(element);
+ JUnitTestCase.assertTrue(type.isMoreSpecificThan(type));
+ }
void test_creation() {
JUnitTestCase.assertNotNull(new TypeVariableTypeImpl(new TypeVariableElementImpl(ASTFactory.identifier3("E"))));
}
@@ -1627,6 +1637,13 @@ class TypeVariableTypeImplTest extends EngineTestCase {
TypeVariableTypeImpl type = new TypeVariableTypeImpl(element);
JUnitTestCase.assertEquals(element, type.element);
}
+ void test_isMoreSpecificThan_typeArguments_upperBound() {
+ ClassElementImpl classS = ElementFactory.classElement2("A", []);
+ TypeVariableElementImpl typeVarT = new TypeVariableElementImpl(ASTFactory.identifier3("T"));
+ typeVarT.bound = classS.type;
+ TypeVariableTypeImpl typeVarTypeT = new TypeVariableTypeImpl(typeVarT);
+ JUnitTestCase.assertTrue(typeVarTypeT.isMoreSpecificThan(classS.type));
+ }
void test_substitute_equal() {
TypeVariableElementImpl element = new TypeVariableElementImpl(ASTFactory.identifier3("E"));
TypeVariableTypeImpl type = new TypeVariableTypeImpl(element);
@@ -1650,6 +1667,10 @@ class TypeVariableTypeImplTest extends EngineTestCase {
final __test = new TypeVariableTypeImplTest();
runJUnitTest(__test, __test.test_getElement);
});
+ _ut.test('test_isMoreSpecificThan_typeArguments_upperBound', () {
+ final __test = new TypeVariableTypeImplTest();
+ runJUnitTest(__test, __test.test_isMoreSpecificThan_typeArguments_upperBound);
+ });
_ut.test('test_substitute_equal', () {
final __test = new TypeVariableTypeImplTest();
runJUnitTest(__test, __test.test_substitute_equal);
@@ -2356,6 +2377,15 @@ class FunctionTypeImplTest extends EngineTestCase {
FunctionTypeImpl type = new FunctionTypeImpl.con1((null as ExecutableElement));
type.hashCode;
}
+ void test_isAssignableTo_normalAndPositionalArgs() {
+ ClassElement a = ElementFactory.classElement2("A", []);
+ FunctionType t = ElementFactory.functionElement6("t", null, <ClassElement> [a]).type;
+ FunctionType s = ElementFactory.functionElement5("s", <ClassElement> [a]).type;
+ JUnitTestCase.assertTrue(t.isSubtypeOf(s));
+ JUnitTestCase.assertFalse(s.isSubtypeOf(t));
+ JUnitTestCase.assertTrue(t.isAssignableTo(s));
+ JUnitTestCase.assertFalse(s.isAssignableTo(t));
+ }
void test_isSubtypeOf_baseCase_classFunction() {
ClassElementImpl functionElement = ElementFactory.classElement2("Function", []);
InterfaceTypeImpl functionType = new InterfaceTypeImpl_21(functionElement);
@@ -2679,6 +2709,10 @@ class FunctionTypeImplTest extends EngineTestCase {
final __test = new FunctionTypeImplTest();
runJUnitTest(__test, __test.test_hashCode_noElement);
});
+ _ut.test('test_isAssignableTo_normalAndPositionalArgs', () {
+ final __test = new FunctionTypeImplTest();
+ runJUnitTest(__test, __test.test_isAssignableTo_normalAndPositionalArgs);
+ });
_ut.test('test_isSubtypeOf_Object', () {
final __test = new FunctionTypeImplTest();
runJUnitTest(__test, __test.test_isSubtypeOf_Object);

Powered by Google App Engine
This is Rietveld 408576698