[svn:parrot] r40690 - trunk/t/op
dukeleto at svn.parrot.org
dukeleto at svn.parrot.org
Fri Aug 21 09:09:08 UTC 2009
Author: dukeleto
Date: Fri Aug 21 09:09:07 2009
New Revision: 40690
URL: https://trac.parrot.org/parrot/changeset/40690
Log:
[t] Add more tests for NaN/Inf behavior
Modified:
trunk/t/op/arithmetics.t
Modified: trunk/t/op/arithmetics.t
==============================================================================
--- trunk/t/op/arithmetics.t Fri Aug 21 09:07:21 2009 (r40689)
+++ trunk/t/op/arithmetics.t Fri Aug 21 09:09:07 2009 (r40690)
@@ -7,7 +7,7 @@
use lib qw( . lib ../lib ../../lib );
use Test::More;
-use Parrot::Test tests => 27;
+use Parrot::Test tests => 31;
# test for GMP
use Parrot::Config;
@@ -636,7 +636,61 @@
NaN
OUTPUT
-pir_output_is( <<'CODE', <<OUTPUT, "Inf - ln" );
+pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - sin" );
+.sub 'test' :main
+ $N0 = 'Inf'
+ $N1 = sin $N0
+ say $N1
+ $N0 = '-Inf'
+ $N1 = sin $N0
+ say $N1
+ $N0 = 'NaN'
+ $N1 = sin $N0
+ say $N1
+.end
+CODE
+NaN
+NaN
+NaN
+OUTPUT
+
+pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - tan" );
+.sub 'test' :main
+ $N0 = 'Inf'
+ $N1 = tan $N0
+ say $N1
+ $N0 = '-Inf'
+ $N1 = tan $N0
+ say $N1
+ $N0 = 'NaN'
+ $N1 = tan $N0
+ say $N1
+.end
+CODE
+NaN
+NaN
+NaN
+OUTPUT
+
+pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - cos" );
+.sub 'test' :main
+ $N0 = 'Inf'
+ $N1 = cos $N0
+ say $N1
+ $N0 = '-Inf'
+ $N1 = cos $N0
+ say $N1
+ $N0 = 'NaN'
+ $N1 = cos $N0
+ say $N1
+.end
+CODE
+NaN
+NaN
+NaN
+OUTPUT
+
+pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - ln" );
.sub 'test' :main
$N0 = 'Inf'
$N1 = ln $N0
@@ -644,9 +698,33 @@
$N0 = '-Inf'
$N1 = ln $N0
say $N1
+ $N0 = 'NaN'
+ $N1 = ln $N0
+ say $N1
+.end
+CODE
+Inf
+NaN
+NaN
+OUTPUT
+
+pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - pow" );
+.sub 'test' :main
+ $N0 = 'Inf'
+ pow $N1, $N0, 2
+ say $N1
+ pow $N1, 2, $N0
+ say $N1
+ $N0 = 'NaN'
+ pow $N1, $N0, 2
+ say $N1
+ pow $N1, 2, $N0
+ say $N1
.end
CODE
Inf
+Inf
+NaN
NaN
OUTPUT
More information about the parrot-commits
mailing list