diff options
| author | Teddy Wing | 2021-08-19 23:52:37 +0200 |
|---|---|---|
| committer | Teddy Wing | 2021-08-19 23:52:37 +0200 |
| commit | 045950b01cdbee910cab980d998edffe1b9c1ebd (patch) | |
| tree | 93cc47dc1dd32803bbbdb183c57388ba250c05de /t/100-increment-decrement.t | |
| parent | c16d56b927ad786f8fa299b9ce5b746f7434a2e7 (diff) | |
| download | readline-incdec-045950b01cdbee910cab980d998edffe1b9c1ebd.tar.bz2 | |
100-increment-decrement: Add a few new test cases
Diffstat (limited to 't/100-increment-decrement.t')
| -rw-r--r-- | t/100-increment-decrement.t | 24 |
1 files changed, 24 insertions, 0 deletions
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 @@ -50,6 +50,12 @@ is( ); 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', 'increments the fourth double-digit integer with point at position 16' @@ -74,6 +80,12 @@ is( ); 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', 'decrements the first integer' @@ -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; |
