Index: t/op/integer.t =================================================================== --- t/op/integer.t (révision 39814) +++ t/op/integer.t (copie de travail) @@ -1,13 +1,7 @@ -#!perl -# Copyright (C) 2001-2008, Parrot Foundation. +#!parrot +# Copyright (C) 2001-2009, Parrot Foundation. # $Id$ -use strict; -use warnings; -use lib qw( . lib ../lib ../../lib ); -use Test::More; -use Parrot::Test tests => 56; - =head1 NAME t/op/integer.t - Integer Registers @@ -22,1359 +16,1099 @@ =cut -pasm_output_is( < $I0 goto test_gt_1 + $I4 = 1 + test_gt_1: + ok($I4, 'gt_i_i - true inequality') -ERROR: - print "bad\\n" - end -CODE -ok 1 -ok 2 -ok 3 -OUTPUT + $I4 = 0 + if $I0 > $I1 goto test_gt_2 + $I4 = 1 + test_gt_2: + ok($I4, 'gt_i_i - false inequality') -pasm_output_is( < $I3 goto test_gt_3 + $I4 = 1 + test_gt_3: + ok($I4, 'gt_i_i - irreflexive') - gt I1, I0, ONE - branch ERROR - print "bad\\n" + $I4 = 0 + if $I0 > 2147483647 goto test_gt_4 + $I4 = 1 + test_gt_4: + ok($I4, 'gt_i_ic - false inequality') -ONE: - print "ok 1\\n" - gt I0, I1, ERROR - branch TWO - print "bad\\n" + $I4 = 0 + unless $I1 > -2147483648 goto test_gt_5 + $I4 = 1 + test_gt_5: + ok($I4, 'gt_i_ic - true inequality') -TWO: - print "ok 2\\n" - gt I2, I3, ERROR - branch THREE - print "bad\\n" + $I4 = 0 + if $I0 > 0 goto test_gt_6 + $I4 = 1 + test_gt_6: + ok($I4, 'gt_i_ic - another false inequality') +.end -THREE: - print "ok 3\\n" - end +.sub 'test_ge' + $I0 = -2147483648 + $I1 = 2147483647 + $I2 = 0 + $I3 = 0 -ERROR: - print "bad\\n" - end -CODE -ok 1 -ok 2 -ok 3 -OUTPUT + $I4 = 0 + unless $I1 >= $I0 goto test_ge_1 + $I4 = 1 + test_ge_1: + ok($I4, 'ge_i_i - true inequality') -pasm_output_is( <= $I1 goto test_ge_2 + $I4 = 1 + test_ge_2: + ok($I4, 'ge_i_i - false inequality') - gt I0, 2147483647, ERROR - branch ONE - print "bad\\n" + $I4 = 0 + unless $I2 >= $I3 goto test_ge_3 + $I4 = 1 + test_ge_3: + ok($I4, 'ge_i_i - reflexive') -ONE: - print "ok 1\\n" - gt I1, -2147483648, TWO - branch ERROR - print "bad\\n" + $I4 = 0 + if $I0 >= 2147483647 goto test_ge_4 + $I4 = 1 + test_ge_4: + ok($I4, 'ge_i_ic - false inequality') -TWO: - print "ok 2\\n" - gt I0, 0, ERROR - branch THREE - print "bad\\n" + $I4 = 0 + unless $I1 >= -2147483648 goto test_ge_5 + $I4 = 1 + test_ge_5: + ok($I4, 'ge_i_ic - true inequality') -THREE: - print "ok 3\\n" - end + $I4 = 0 + unless $I2 >= 0 goto test_ge_6 + $I4 = 1 + test_ge_6: + ok($I4, 'ge_i_ic - reflexivity') +.end -ERROR: - print "bad\\n" - end -CODE -ok 1 -ok 2 -ok 3 -OUTPUT +.sub 'test_not' + $I0 = 1 + $I1 = not $I0 + is($I1, 0, 'not_i_i - not 1') -pasm_output_is( <