[libinline-java-perl] 98/398: added Number tests

Jonas Smedegaard dr at jones.dk
Thu Feb 26 11:42:54 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.55
in repository libinline-java-perl.

commit 6ad27fafe9ca8118e155024dbe60db96dd7a239c
Author: Patrick LeBoutillier <patl at cpan.org>
Date:   Fri Jun 1 17:26:14 2001 +0000

    added Number tests
---
 t/02_primitives.t | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/t/02_primitives.t b/t/02_primitives.t
index 6a0e146..360c445 100644
--- a/t/02_primitives.t
+++ b/t/02_primitives.t
@@ -10,7 +10,7 @@ use Inline(
 
 
 BEGIN {
-	plan(tests => 100) ;
+	plan(tests => 106) ;
 }
 
 
@@ -109,6 +109,16 @@ ok($t->_Double("$min") == $min) ;
 eval {$t->_Double($max + $max)} ; ok($@, qr/out of range/) ;
 eval {$t->_Double($min + $min)} ; ok($@, qr/out of range/) ;
 
+# Number is forced to Double
+$max = 3.4028235e38 ;
+$min = -3.4028235e38 ;
+ok($t->_Number(undef) == 0) ;
+ok($t->_Number(0) == 0) ;
+ok($t->_Number($max) == $max) ;
+ok($t->_Number("$min") == $min) ;
+eval {$t->_Number($max + $max)} ; ok($@, qr/out of range/) ;
+eval {$t->_Number($min + $min)} ; ok($@, qr/out of range/) ;
+
 ok(! $t->_boolean(undef)) ;
 ok(! $t->_boolean(0)) ;
 ok(! $t->_boolean("")) ;
@@ -202,6 +212,10 @@ class types {
 		return d ;
 	}
 
+	public Number _Number(Number n){
+		return n ;
+	}
+
 	public boolean _boolean(boolean b){
 		return b ;
 	}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libinline-java-perl.git



More information about the Pkg-perl-cvs-commits mailing list