#!perl

use strict;
use warnings;
use lib qw(t . lib ../lib ../../lib ../../../lib);
use Parrot::Test tests => 2;

language_output_is( 'punie', <<'CODE', <<'OUT', 'simple math ops' );
print 1 + 2, "\n";
print 3 - 2, "\n";
print 4 * 4, "\n";
print 4 / 2, "\n";
print 5 % 2, "\n";
CODE
3
1
16
2
1
OUT

language_output_is( 'punie', <<'CODE', <<'OUT', 'simple bitwise ops' );
print 32 << 2, "\n";
print 32 >> 2, "\n";
print 36 & 4, "\n";
print 32 | 4, "\n";
print 36 ^ 4, "\n";
CODE
128
8
4
36
32
OUT

# Local Variables:
#   mode: cperl
#   cperl-indent-level: 4
#   fill-column: 100
# End:
# vim: expandtab shiftwidth=4:


#!perl

use strict;
use warnings;
use lib qw(t . lib ../lib ../../lib ../../../lib);
use Parrot::Test tests => 3;

language_output_is( 'punie', <<'CODE', <<'OUT', 'simple math ops' );
print 1 + 2, "\n";
print 3 - 2, "\n";
print 4 * 4, "\n";
print 4 / 2, "\n";
print 5 % 2, "\n";
CODE
3
1
16
2
1
OUT

language_output_is( 'punie', <<'CODE', <<'OUT', 'simple bitwise ops' );
print 32 << 2, "\n";
print 32 >> 2, "\n";
print 36 & 4, "\n";
print 32 | 4, "\n";
print 36 ^ 4, "\n";
CODE
128
8
4
36
32
OUT

language_output_is( 'punie', <<'CODE', <<'OUT', 'combined math ops' );
print 3 + 4 * 5, "\n";
print 3 * 4 + 5, "\n";
print 0 + ((2 + 3) * 7), "\n";
print 1 * 2 * 3 * 4, "\n";
print (5 * 6, "\n");
print 2 + (5 - 4) * 3, "\n";
print 2 + 5 - 4 * 3, "\n";
CODE
23
17
35
24
30
5
-5
OUT

# Local Variables:
#   mode: cperl
#   cperl-indent-level: 4
#   fill-column: 100
# End:
# vim: expandtab shiftwidth=4:


Add a test for complex interactions between simple math ops (Shlomi Fish).
[punie]: Add a test for complex interactions between simple math ops (Shlomi Fish).


git-svn-id: 6e74a02f85675cec270f5d931b0f6998666294a3@18550 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
