[Pkg-octave-devel] Test 2 of Inline::Octave failing

Rafael Laboissiere rafael at debian.org
Fri Oct 21 07:43:29 UTC 2005


Hi Andy,

Test t/2_calling.t of Inline::Octave v0.22 fails in my Debian box with
Octave 2.1.71:


$ perl t/2_calling.t
1..3
# Running under perl version 5.008007 for linux
# Current time local: Fri Oct 21 09:35:51 2005
# Current time GMT:   Fri Oct 21 07:35:51 2005
# Using Test.pm version 1.25
ok 1
ok 2
in toascii near line 1, column 25:; implicit conversion from scalar to
string; (in octave code) at (eval 11) line 28
not ok 3
# Test 3 got: " (t/2_calling.t at line 35)
#   Expected: "1"
#  t/2_calling.t line 35 is: ok( $ok, 1);


It seems that the "in toascii near [...]" error message is not captured
by the $@ variable.  The patch below, which apply the same technique used
for jnk2() to jnk3() fixes the problem:


--- 2_calling.t-orig	2005-10-21 09:40:54.658269488 +0200
+++ 2_calling.t	2005-10-21 09:41:32.019589704 +0200
@@ -26,10 +26,13 @@
   $v= jnk2(0)->disp();
 };
 
+do {
+  local $SIG{__WARN__} = sub {
+     my $ok = ($_[0] =~ /toascii/);
+     ok( $ok, 1);
+  };
+
 # jnk3 gives error for u real
-eval {
    jnk3(0);
 };
 
-my $ok = ($@ =~ /toascii/);
-ok( $ok, 1);




-- 
Rafael



More information about the Pkg-octave-devel mailing list