1
0
Fork 0
mirror of https://github.com/perlbot/perlbuut synced 2025-06-07 10:35:41 -04:00
perlbuut/deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/text-base/12dblret.t.svn-base
2009-12-05 00:02:04 -05:00

25 lines
763 B
Text

######################################################################
# Testcase: Returning double values from perl
# Revision: $Revision: 1.1 $
# Last Checkin: $Date: 2006/06/13 13:43:51 $
# By: $Author: thomas_busch $
#
# Author: Marc Relation marc@igneousconsulting.com
######################################################################
use warnings;
use strict;
print "1..1\n";
use JavaScript::SpiderMonkey;
my $js=new JavaScript::SpiderMonkey;
my $buffer;
$js->init;
$js->function_set('get_double',sub {return(10.21);});
$js->function_set("write",sub { $buffer .= join('', @_) });
$js->eval("write(get_double()+1.2);");
$js->destroy;
# Check buffer from document.write()
print "not " unless $buffer == 11.41;
print "ok 1\n";