cvsuser 02/06/07 08:06:21
Modified: . core.ops
t/op string.t
Log:
Fixed set_s_nc and added test.
Revision Changes Path
1.148 +1 -1 parrot/core.ops
Index: core.ops
===================================================================
RCS file: /cvs/public/parrot/core.ops,v
retrieving revision 1.147
retrieving revision 1.148
diff -u -w -r1.147 -r1.148
--- core.ops 5 Jun 2002 01:56:08 -0000 1.147
+++ core.ops 7 Jun 2002 15:06:20 -0000 1.148
@@ -624,7 +624,7 @@
}
inline op set(out STR, in NUM) {
- $1 = Parrot_sprintf_c(interpreter, "%f", $2);
+ $1 = string_from_num(interpreter, $2);
goto NEXT();
}
1.27 +10 -1 parrot/t/op/string.t
Index: string.t
===================================================================
RCS file: /cvs/public/parrot/t/op/string.t,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -w -r1.26 -r1.27
--- string.t 7 Jun 2002 03:45:56 -0000 1.26
+++ string.t 7 Jun 2002 15:06:21 -0000 1.27
@@ -1,6 +1,6 @@
#! perl -w
-use Parrot::Test tests => 82;
+use Parrot::Test tests => 83;
use Test::More;
output_is( <<'CODE', <<OUTPUT, "set_s_s|sc" );
@@ -1140,6 +1140,15 @@
-1
OUTPUT
+output_is(<<'CODE',<<OUTPUT,"string to num");
+ set N0, 80.43
+ set S0, N0
+ print S0
+ print "\n"
+ end
+CODE
+80.430000
+OUTPUT
# Set all string registers to values given by &$_[0](reg num)
sub set_str_regs {