From 045950b01cdbee910cab980d998edffe1b9c1ebd Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 19 Aug 2021 23:52:37 +0200 Subject: 100-increment-decrement: Add a few new test cases --- t/100-increment-decrement.t | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/t/100-increment-decrement.t b/t/100-increment-decrement.t index 4af73d5..b04a379 100644 --- a/t/100-increment-decrement.t +++ b/t/100-increment-decrement.t @@ -49,6 +49,12 @@ is( 'increments the third triple-digit integer with point at position 12' ); +is( + incdec::incdec('test 12 19 555', 7, 9), + 'test 12 26 555', + 'increments the second double-digit integer by 7 with point at position 9' +); + is( incdec::incdec('test 12 19 555 64', 1, 16), 'test 12 19 555 65', @@ -73,6 +79,12 @@ is( 'increments the third triple-digit integer with point at position 14 backward' ); +is( + incdec::incdec('test 12 982 4 ', 1, 14, 1), + 'test 12 982 5 ', + 'increments the third integer with point at position 14 backward' +); + is( incdec::incdec('test 12', -1), 'test 11', @@ -97,4 +109,16 @@ is( 'decrements the second integer with point at position 9 backward' ); +is( + incdec::incdec('test 12 982 4', -5, 8, 1), + 'test 12 977 4', + 'decrements the second integer by 5 with point at position 8 backward' +); + +is( + incdec::incdec('test 12 1 4', -2, 9, 1), + 'test 12 -1 4', + 'decrements the second integer by 2 with point at position 9 backward' +); + done_testing; -- cgit v1.2.3