From 6a2d1fc08c17b417a25156bdadcaf45d1929ea4f Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 22 Aug 2021 01:36:02 +0200 Subject: 100-increment-decrement: Add new second number negative integer tests The previous negative integer tests worked, but it turns out that when the negative integer isn't the first one, there's a problem. --- t/100-increment-decrement.t | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 't/100-increment-decrement.t') diff --git a/t/100-increment-decrement.t b/t/100-increment-decrement.t index b5b852f..a7927ea 100644 --- a/t/100-increment-decrement.t +++ b/t/100-increment-decrement.t @@ -97,6 +97,18 @@ is( 'decrements the negative integer with point at position 7 backward' ); +is( + incdec::incdec('test 1 -2', 1, 8, 1), + 'test 1 -1', + 'increments the second negative integer with point at position 8 backward' +); + +is( + incdec::incdec('test 1 -2', -1, 8, 1), + 'test 1 -3', + 'decrements the second negative integer with point at position 8 backward' +); + is( incdec::incdec('test 12', -1), 'test 11', -- cgit v1.2.3