OLD | NEW |
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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 expectEvaluatesTo(false, ()=> false && false); | 435 expectEvaluatesTo(false, ()=> false && false); |
436 | 436 |
437 // Bitwise operations. | 437 // Bitwise operations. |
438 expectEvaluatesTo(3, ()=> 1 | 2); | 438 expectEvaluatesTo(3, ()=> 1 | 2); |
439 expectEvaluatesTo(2, ()=> 3 ^ 1); | 439 expectEvaluatesTo(2, ()=> 3 ^ 1); |
440 expectEvaluatesTo(1, ()=> 3 & 1); | 440 expectEvaluatesTo(1, ()=> 3 & 1); |
441 | 441 |
442 // Equality. | 442 // Equality. |
443 expectEvaluatesTo(true, ()=> 1 == 1); | 443 expectEvaluatesTo(true, ()=> 1 == 1); |
444 expectEvaluatesTo(false, ()=> 1 != 1); | 444 expectEvaluatesTo(false, ()=> 1 != 1); |
445 expectEvaluatesTo(true, ()=> 1 === 1); | 445 expectEvaluatesTo(true, ()=> identical(1, 1)); |
446 expectEvaluatesTo(false, ()=> 1 !== 1); | 446 expectEvaluatesTo(false, ()=> !identical(1, 1)); |
447 | 447 |
448 // Relational. | 448 // Relational. |
449 expectEvaluatesTo(true, ()=> 1 <= 1); | 449 expectEvaluatesTo(true, ()=> 1 <= 1); |
450 expectEvaluatesTo(false, ()=> 1 < 1); | 450 expectEvaluatesTo(false, ()=> 1 < 1); |
451 expectEvaluatesTo(false, ()=> 1 > 1); | 451 expectEvaluatesTo(false, ()=> 1 > 1); |
452 expectEvaluatesTo(true, ()=> 1 >= 1); | 452 expectEvaluatesTo(true, ()=> 1 >= 1); |
453 | 453 |
454 // Is. | 454 // Is. |
455 expectEvaluatesTo(true, ()=> 1 is int); | 455 expectEvaluatesTo(true, ()=> 1 is int); |
456 expectEvaluatesTo(true, ()=> 1.0 is double); | 456 expectEvaluatesTo(true, ()=> 1.0 is double); |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 | 621 |
622 } | 622 } |
623 | 623 |
624 main | 624 main |
625 /* /// 74: compile-time error | 625 /* /// 74: compile-time error |
626 () | 626 () |
627 */ /// 74: continued | 627 */ /// 74: continued |
628 { | 628 { |
629 FunctionSyntaxTest.testMain(); | 629 FunctionSyntaxTest.testMain(); |
630 } | 630 } |
OLD | NEW |