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

Side by Side Diff: tests/language/no_such_method_test.dart

Issue 11293009: Fix bug in another no_such_method test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/language/language.status ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 // Dart test program testing that NoSuchMethod is properly called. 4 // Dart test program testing that NoSuchMethod is properly called.
5 5
6 class NoSuchMethodTest { 6 class NoSuchMethodTest {
7 7
8 foo({a = 10, b = 20}) { 8 foo({a : 10, b : 20}) {
9 return (10 * a) + b; 9 return (10 * a) + b;
10 } 10 }
11 11
12 noSuchMethod(InvocationMirror im) { 12 noSuchMethod(InvocationMirror im) {
13 Expect.equals("moo", im.memberName); 13 Expect.equals("moo", im.memberName);
14 Expect.equals(0, im.positionalArguments.length); 14 Expect.equals(0, im.positionalArguments.length);
15 Expect.equals(1, im.namedArguments.length); 15 Expect.equals(1, im.namedArguments.length);
16 return foo(b:im.namedArguments["b"]); 16 return foo(b:im.namedArguments["b"]);
17 } 17 }
18 18
19 static testMain() { 19 static testMain() {
20 var obj = new NoSuchMethodTest(); 20 var obj = new NoSuchMethodTest();
21 Expect.equals(199, obj.moo(b:99)); // obj.NoSuchMethod called here. 21 Expect.equals(199, obj.moo(b:99)); // obj.NoSuchMethod called here.
22 } 22 }
23 } 23 }
24 24
25 main() { 25 main() {
26 NoSuchMethodTest.testMain(); 26 NoSuchMethodTest.testMain();
27 } 27 }
OLDNEW
« no previous file with comments | « tests/language/language.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698