Chromium Code Reviews| Index: tests/compiler/dart2js/resolver_test.dart |
| diff --git a/tests/compiler/dart2js/resolver_test.dart b/tests/compiler/dart2js/resolver_test.dart |
| index b6044da86b667d5cab6eff2c330124f813c8201e..61b19a5149c0e77e087cd6caf07b72b9248d4ce4 100644 |
| --- a/tests/compiler/dart2js/resolver_test.dart |
| +++ b/tests/compiler/dart2js/resolver_test.dart |
| @@ -2,10 +2,13 @@ |
| // for details. All rights reserved. Use of this source code is governed by a |
| // BSD-style license that can be found in the LICENSE file. |
| +#import('dart:uri'); |
| + |
| #import("../../../lib/compiler/implementation/leg.dart"); |
| #import("../../../lib/compiler/implementation/elements/elements.dart"); |
| #import("../../../lib/compiler/implementation/tree/tree.dart"); |
| #import("../../../lib/compiler/implementation/util/util.dart"); |
| +#import("compiler_helper.dart"); |
| #import("mock_compiler.dart"); |
| #import("parser_helper.dart"); |
| @@ -69,6 +72,7 @@ main() { |
| testThis(); |
| testSuperCalls(); |
| testTypeVariables(); |
| + testToString(); |
| } |
| testTypeVariables() { |
| @@ -718,3 +722,18 @@ List<String> asSortedStrings(Link link) { |
| result.sort((s1, s2) => s1.compareTo(s2)); |
| return result; |
| } |
| + |
| +testToString() { |
| + Uri uri = new Uri.fromComponents(scheme: 'source'); |
| + MockCompiler compiler = compilerFor( |
| + @"class C { toString() => 'C'; } main() { '${new C()}'; }", |
| + uri); |
| + compiler.runCompiler(uri); |
| + |
| + Element toStringMethod = findElement(compiler, 'C') |
| + .lookupLocalMember(buildSourceString('toString')); |
| + Expect.isNotNull(toStringMethod); |
| + |
| + final resolvedElements = compiler.enqueuer.resolution.resolvedElements; |
|
ahe
2012/08/13 15:55:53
Please use:
Expect.isNotNull(compiler.enqueuer.re
Anton Muhin
2012/08/13 16:09:14
Done.
|
| + Expect.isTrue(resolvedElements.containsKey(toStringMethod)); |
| +} |