Chromium Code Reviews| Index: tests/compiler/dart2js/mirrors_test.dart |
| diff --git a/tests/compiler/dart2js/mirrors_test.dart b/tests/compiler/dart2js/mirrors_test.dart |
| index 5ef944c1f59e7a438dde3a456841ef3a7226b13d..da88e3c87e202a2c454654a3a798cbc7ba06f0fe 100644 |
| --- a/tests/compiler/dart2js/mirrors_test.dart |
| +++ b/tests/compiler/dart2js/mirrors_test.dart |
| @@ -441,12 +441,10 @@ void testBaz(MirrorSystem system, LibraryMirror helperLibrary, |
| Expect.stringEquals("mirrors_helper.Baz.method2#f", |
| method2Parameter2.qualifiedName(), |
| "Unexpected parameter qualifiedName"); |
| - // TODO(johnniwinther): Should return true: |
| - Expect.isFalse(method2Parameter2.hasDefaultValue(), |
| + Expect.isTrue(method2Parameter2.hasDefaultValue(), |
| "Parameter has default value"); |
| - // TODO(johnniwinther): Should return a non-null value: |
| - Expect.isNull(method2Parameter2.defaultValue(), |
| - "Parameter default value is non-null"); |
| + Expect.stringEquals("null", method2Parameter2.defaultValue(), |
| + "Parameter default value is non-null"); |
| Expect.isTrue(method2Parameter2.isOptional(), "Parameter is not optional"); |
| //////////////////////////////////////////////////////////////////////////// |
| @@ -485,7 +483,24 @@ void testBaz(MirrorSystem system, LibraryMirror helperLibrary, |
| var method3Parameter1 = method3Parameters[0]; |
| Expect.isNotNull(method3Parameter1, "Parameter is null"); |
| // TODO(johnniwinther): Should return the function type E func(F f): |
|
floitsch
2012/07/17 18:53:04
Remove TODO.
Johnni Winther
2012/07/19 13:12:11
Done.
|
| - Expect.equals(dynamicType, method3Parameter1.type()); |
| + var method3Parameter1type = method3Parameter1.type(); |
| + Expect.isNotNull(method3Parameter1type, "Parameter type of 'func1' is null"); |
|
floitsch
2012/07/17 18:53:04
Where does the "func1" come from?
Johnni Winther
2012/07/19 13:12:11
func1 is the name of the first parameter of method
|
| + Expect.isTrue(method3Parameter1type is FunctionTypeMirror, |
| + "Parameter type of 'func1' is not a function"); |
| + Expect.equals(bazE, method3Parameter1type.returnType(), |
| + "Return type of 'func1' is not a E"); |
| + Expect.isNotNull(method3Parameter1type.parameters(), |
| + "Parameters of 'func1' is null"); |
|
floitsch
2012/07/17 18:53:04
nit: align.
Johnni Winther
2012/07/19 13:12:11
Done.
|
| + Expect.equals(1, method3Parameter1type.parameters().length, |
| + "Unexpected parameter count of 'func1'"); |
| + Expect.equals(bazE, method3Parameter1type.returnType(), |
| + "Return type of 'func1' is not a E"); |
| + Expect.isNotNull(method3Parameter1type.parameters()[0], |
| + "Parameter 1 of 'func1' is null"); |
| + Expect.stringEquals('f', method3Parameter1type.parameters()[0].simpleName(), |
| + "Unexpected name parameter 1 of 'func1'"); |
| + Expect.equals(bazF, method3Parameter1type.parameters()[0].type(), |
| + "Return type of 'func1' is not a F"); |
|
floitsch
2012/07/17 18:53:04
That's not the return type.
Johnni Winther
2012/07/19 13:12:11
Fixed.
|
| Expect.stringEquals("func1", method3Parameter1.simpleName(), |
| "Unexpected parameter simpleName"); |
| Expect.stringEquals("mirrors_helper.Baz.method3#func1", |
| @@ -549,7 +564,8 @@ void testBaz(MirrorSystem system, LibraryMirror helperLibrary, |
| method3Parameter2.qualifiedName(), |
| "Unexpected parameter qualifiedName"); |
| Expect.isFalse(method3Parameter2.hasDefaultValue(), |
| - "Parameter has default value"); |
| + "Parameter 'func2' has default value: " |
| + "${method3Parameter2.defaultValue()}"); |
| Expect.isNull(method3Parameter2.defaultValue(), |
| "Parameter default value is non-null"); |
| Expect.isFalse(method3Parameter2.isOptional(), "Parameter is optional"); |