From a4bd55db89de4851d4dfa31d9c3ec44e7e000980 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Tue, 12 Jul 2022 00:22:41 +0200 Subject: t/100-increment-decrement.t: Add test for character after number removed Noticed while using the increment function that the character following a "0" is removed after incrementing it, at least in a certain case. Add a failing test for this case so we can fix it. --- t/100-increment-decrement.t | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/t/100-increment-decrement.t b/t/100-increment-decrement.t index cba66e8..431779d 100644 --- a/t/100-increment-decrement.t +++ b/t/100-increment-decrement.t @@ -60,6 +60,14 @@ is_deeply( 'increments a negative integer with a leading zero' ); +@got = incdec::incdec('openssl x509 -inform DER -in codesign0 -text', 1); +@want = ('openssl x509 -inform DER -in codesign1 -text', 37); +is_deeply( + \@got, + \@want, + 'increments a zero without removing the following character' +); + @got = incdec::incdec('test 12 0', 1, 6); @want = ('test 13 0', 5); is_deeply( -- cgit v1.2.3