On Fri Sep 07 10:59:29 2007, colink wrote:
> This test exposes the truthiness/veracity of various numerical constants
> directly, rather than through the examples/tutorial.t test.
>
> The failing test is marked as a TODO.
I'm not sure I understand all the issues Colin raised in this ticket
last year, but I tried out his patch tonight. All tests passed,
including the one that was marked TODO.
So I removed the TODO and committed the attached version to trunk in r28369.
Do we still have a bug? If not, we can close this ticket.
Thank you very much.
kid51
Index: MANIFEST
===================================================================
--- MANIFEST (revision 28365)
+++ MANIFEST (working copy)
@@ -1,7 +1,7 @@
# ex: set ro:
# $Id$
#
-# generated by tools\dev\mk_manifest_and_skip.pl Fri Jun 13 09:22:55 2008 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Sun Jun 15 01:05:26 2008 UT
#
# See tools/dev/install_files.pl for documentation on the
# format of this file.
@@ -3059,6 +3059,7 @@
t/compilers/imcc/syn/scope.t []
t/compilers/imcc/syn/symbols.t []
t/compilers/imcc/syn/tail.t []
+t/compilers/imcc/syn/veracity.t []
t/compilers/json/from_parrot.t []
t/compilers/json/to_parrot.t []
t/compilers/pct/NoneGrammar.tg []
Index: t/compilers/imcc/syn/veracity.t
===================================================================
--- t/compilers/imcc/syn/veracity.t (revision 0)
+++ t/compilers/imcc/syn/veracity.t (revision 0)
@@ -0,0 +1,129 @@
+#!perl
+# Copyright (C) 2001-2006, The Perl Foundation.
+# $Id$
+
+use strict;
+use warnings;
+use lib qw( . lib ../lib ../../lib );
+
+use Test::More;
+use Parrot::Config;
+use Parrot::Test tests => 5;
+
+pir_output_is( <<'CODE', <<'OUT', "Positive and negative integers" );
+.sub test :main
+ $I0 = 1
+ unless $I0 goto not_one
+ say "1 is true"
+
+ not_one:
+ $I0 = -1
+ unless $I0 goto not_neg_one
+ say "-1 is true"
+
+ not_neg_one:
+
+ end
+.end
+CODE
+1 is true
+-1 is true
+OUT
+
+pir_output_is( <<'CODE', <<'OUT', "Integer zeros" );
+.sub test :main
+ $I0 = 0
+ if $I0 goto not_zero
+ say "0 is false"
+
+ not_zero:
+ $I0 = -0
+ if $I0 goto not_neg_zero
+ say "-0 is false"
+
+ not_neg_zero:
+
+ end
+.end
+CODE
+0 is false
+-0 is false
+OUT
+
+pir_output_is( <<'CODE', <<'OUT', "Positive and negative floats" );
+.sub test :main
+ $N0 = 1.0
+ unless $N0 goto not_one
+ say "1.0 is true"
+
+ not_one:
+ $N0 = -1.0
+ unless $N0 goto not_neg_one
+ say "-1.0 is true"
+
+ not_neg_one:
+ $N0 = 0.5
+ unless $N0 goto not_pfive
+ say "0.5 is true"
+
+ not_pfive:
+ $N0 = 1e-33
+ unless $N0 goto not_small
+ say "1e-33 is true"
+
+ not_small:
+ end
+.end
+CODE
+1.0 is true
+-1.0 is true
+0.5 is true
+1e-33 is true
+OUT
+
+#TODO: {
+
+#local $TODO = "Failing due to FLOAT_IS_ZERO macro";
+
+pir_output_is( <<'CODE', <<'OUT', "Float zeros" );
+.sub test :main
+ $N0 = 0.0
+ if $N0 goto not_zero
+ say "0.0 is false"
+
+ not_zero:
+ $N0 = -0.0
+ if $N0 goto not_neg_zero
+ say "-0.0 is false"
+
+ not_neg_zero:
+
+ end
+.end
+CODE
+0.0 is false
+-0.0 is false
+OUT
+
+#}
+
+pir_output_is( <<'CODE', <<'OUT', "Float NaN" );
+.sub test :main
+ $N0 = 'NaN'
+ unless $N0 goto not_nan
+ say "NaN is true"
+
+ not_nan:
+ end
+.end
+CODE
+NaN is true
+OUT
+
+
+# Local Variables:
+# mode: cperl
+# cperl-indent-level: 4
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:
Property changes on: t/compilers/imcc/syn/veracity.t
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native