Author: rgrjr
Date: Sat Jun 2 17:06:45 2007
New Revision: 18770
Modified:
trunk/src/ops/string.ops
trunk/t/op/string.t
Log:
* src/ops/string.ops:
+ (repeat): internal_exception => real_exception.
* t/op/string.t:
+ Plus a test consequence.
Modified: trunk/src/ops/string.ops
==============================================================================
--- trunk/src/ops/string.ops (original)
+++ trunk/src/ops/string.ops Sat Jun 2 17:06:45 2007
@@ -140,9 +140,9 @@
=cut
inline op repeat(out STR, in STR, in INT) :base_mem {
- if ($3 < 0) {
- internal_exception(NEG_REPEAT, "Cannot repeat with negative arg");
- }
+ if ($3 < 0)
+ real_exception(interp, NULL, NEG_REPEAT,
+ "Cannot repeat with negative arg");
$1 = string_repeat(interp, $2, (UINTVAL)$3, NULL);
goto NEXT();
}
Modified: trunk/t/op/string.t
==============================================================================
--- trunk/t/op/string.t (original)
+++ trunk/t/op/string.t Sat Jun 2 17:06:45 2007
@@ -1274,7 +1274,7 @@
>< done
OUTPUT
-pasm_error_output_is( <<'CODE', "Cannot repeat with negative arg\n", 'repeat
OOB' );
+pasm_error_output_like( <<'CODE', qr/Cannot repeat with negative arg\n/,
'repeat OOB' );
repeat S0, "japh", -1
end
CODE