diff options
author | Bo Borgerson <gigabo@gmail.com> | 2009-08-16 11:07:39 -0400 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-08-25 10:22:58 +0200 |
commit | 6aff239d5283e5d4ba7b451221311e53b9690309 (patch) | |
tree | 72a82858d5aa8b3620362688d24c27569904dbb4 /t/op | |
parent | 6eed0921e10b784f6cb4188dd78478d880d46585 (diff) | |
download | perl-6aff239d5283e5d4ba7b451221311e53b9690309.tar.gz |
String with NULL auto-increment bug fix
Check position relative to end of string length rather than whether
char is NULL at end of initial alphanumerics in Perl_sv_inc
Diffstat (limited to 't/op')
-rw-r--r-- | t/op/auto.t | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/t/op/auto.t b/t/op/auto.t index 6dcc201784..ecfe48bba1 100644 --- a/t/op/auto.t +++ b/t/op/auto.t @@ -6,7 +6,7 @@ BEGIN { } require "test.pl"; -plan( tests => 37 ); +plan( tests => 39 ); $x = 10000; cmp_ok(0 + ++$x - 1,'==',10000,'scalar ++x - 1'); @@ -47,6 +47,8 @@ cmp_ok($x{0}, '==',10000,'helem x final'); # test magical autoincrement cmp_ok(++($foo = '99'), 'eq','100','99 incr 100'); +cmp_ok(++($foo = "99a"), 'eq','100','99a incr 100'); +cmp_ok(++($foo = "99\0a"), 'eq','100','99\0a incr 100'); cmp_ok(++($foo = 'a0'), 'eq','a1','a0 incr a1'); cmp_ok(++($foo = 'Az'), 'eq','Ba','Az incr Ba'); cmp_ok(++($foo = 'zz'), 'eq','aaa','zzz incr aaa'); |