Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Now passing 16-ternary.t.
  • Loading branch information
jnthn committed Oct 20, 2010
1 parent 7e9d2b8 commit 1fea9b0
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions t/nqp/16-ternary.t
@@ -0,0 +1,23 @@
#!./parrot nqp.pbc

# the ternary ?? !! operator

plan(8);

ok( 1 ?? 1 !! 0 );
ok( 0 ?? 0 !! 1 );

my $a := 1 ?? 'yes' !! 'no';
ok( $a eq 'yes' );

my $b := 0 ?? 'yes' !! 'no';
ok( $b eq 'no' );

my $c := 1 ?? 'yes' !! ( $a := 'no' );
ok( $c eq 'yes' );
ok( $a eq 'yes' );

my $d := 0 ?? ( $a := 'no' ) !! 'yes';
ok( $d eq 'yes' );
ok( $a eq 'yes' );

0 comments on commit 1fea9b0

Please sign in to comment.