OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 import "package:expect/expect.dart"; | |
6 import 'compiler_helper.dart'; | 5 import 'compiler_helper.dart'; |
7 import 'parser_helper.dart'; | 6 import 'parser_helper.dart'; |
8 | 7 |
9 void compileAndFind(String code, String name, | 8 void compileAndFind(String code, String name, |
10 check(compiler, element)) { | 9 check(compiler, element)) { |
11 Uri uri = new Uri.fromComponents(scheme: 'source'); | 10 Uri uri = new Uri.fromComponents(scheme: 'source'); |
12 var compiler = compilerFor(code, uri); | 11 var compiler = compilerFor(code, uri); |
13 compiler.runCompiler(uri); | 12 compiler.runCompiler(uri); |
14 var element = findElement(compiler, name); | 13 var element = findElement(compiler, name); |
15 return check(compiler, element); | 14 return check(compiler, element); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 compiler.typesTask.getGuaranteedTypeOfElement(secondParameter)); | 92 compiler.typesTask.getGuaranteedTypeOfElement(secondParameter)); |
94 Expect.isNull( | 93 Expect.isNull( |
95 compiler.typesTask.getGuaranteedTypeOfElement(thirdParameter)); | 94 compiler.typesTask.getGuaranteedTypeOfElement(thirdParameter)); |
96 }); | 95 }); |
97 } | 96 } |
98 | 97 |
99 void main() { | 98 void main() { |
100 testBasicTypes(); | 99 testBasicTypes(); |
101 testOptionalParameters(); | 100 testOptionalParameters(); |
102 } | 101 } |
OLD | NEW |