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

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

Issue 11273121: Support closures inside initializers. (Closed) Base URL: http://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
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 4
5 // Tests function statement and expression syntax. 5 // Tests function statement and expression syntax.
6 6
7 class FunctionSyntaxTest { 7 class FunctionSyntaxTest {
8 8
9 static void testMain 9 static void testMain
10 /* /// 00: compile-time error 10 /* /// 00: compile-time error
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 expectEvaluatesTo(2, ()=> 1 + 1); 463 expectEvaluatesTo(2, ()=> 1 + 1);
464 expectEvaluatesTo(1, ()=> 2 - 1); 464 expectEvaluatesTo(1, ()=> 2 - 1);
465 465
466 // Multiplicative. 466 // Multiplicative.
467 expectEvaluatesTo(2, ()=> 1 * 2); 467 expectEvaluatesTo(2, ()=> 1 * 2);
468 expectEvaluatesTo(2.0, ()=> 4 / 2); 468 expectEvaluatesTo(2.0, ()=> 4 / 2);
469 expectEvaluatesTo(2, ()=> 4 ~/ 2); 469 expectEvaluatesTo(2, ()=> 4 ~/ 2);
470 expectEvaluatesTo(0, ()=> 4 % 2); 470 expectEvaluatesTo(0, ()=> 4 % 2);
471 471
472 // Negate. 472 // Negate.
473 expectEvaluatesTo(-3, ()=> ~2);
474 expectEvaluatesTo(false, ()=> !true); 473 expectEvaluatesTo(false, ()=> !true);
475 474
476 // Postfix / prefix. 475 // Postfix / prefix.
477 var y = 0; 476 var y = 0;
478 expectEvaluatesTo(0, ()=> y++); 477 expectEvaluatesTo(0, ()=> y++);
479 expectEvaluatesTo(2, ()=> ++y); 478 expectEvaluatesTo(2, ()=> ++y);
480 expectEvaluatesTo(1, ()=> --y); 479 expectEvaluatesTo(1, ()=> --y);
481 expectEvaluatesTo(1, ()=> y--); 480 expectEvaluatesTo(1, ()=> y--);
482 Expect.equals(0, y); 481 Expect.equals(0, y);
483 482
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 621
623 } 622 }
624 623
625 main 624 main
626 /* /// 74: compile-time error 625 /* /// 74: compile-time error
627 () 626 ()
628 */ /// 74: continued 627 */ /// 74: continued
629 { 628 {
630 FunctionSyntaxTest.testMain(); 629 FunctionSyntaxTest.testMain();
631 } 630 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698