aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorTeddy Wing2021-09-07 20:10:12 +0200
committerTeddy Wing2021-09-07 20:10:12 +0200
commit4b6101765c326b51cc36018f3eb1e0c76fb23450 (patch)
tree75fc52fc4cf8cd603165295963b1c7c18218ad9f /t
parentdc1701625f8a994ff56dac0bd163db94dde26504 (diff)
downloadreadline-incdec-4b6101765c326b51cc36018f3eb1e0c76fb23450.tar.bz2
100-increment-decrement: Swap "want" and "got"
When I refactored the tests to add `@want` and `@got` variables, I made a mistake with the names. Swap the two variables to make their contents reflect the meaning of the words.
Diffstat (limited to 't')
-rw-r--r--t/100-increment-decrement.t164
1 files changed, 82 insertions, 82 deletions
diff --git a/t/100-increment-decrement.t b/t/100-increment-decrement.t
index 181293b..eda27ca 100644
--- a/t/100-increment-decrement.t
+++ b/t/100-increment-decrement.t
@@ -25,222 +25,222 @@ use Test::More;
use lib './';
use incdec;
-my @want;
my @got;
+my @want;
-@want = incdec::incdec('test 12', 1);
-@got = ('test 13', 5);
+@got = incdec::incdec('test 12', 1);
+@want = ('test 13', 5);
is_deeply(
- \@want,
\@got,
+ \@want,
'increments an integer'
);
-@want = incdec::incdec('test 12 0', 1);
-@got = ('test 13 0', 5);
+@got = incdec::incdec('test 12 0', 1);
+@want = ('test 13 0', 5);
is_deeply(
- \@want,
\@got,
+ \@want,
'increments the first integer'
);
-@want = incdec::incdec('test 12 0', 1, 6);
-@got = ('test 13 0', 5);
+@got = incdec::incdec('test 12 0', 1, 6);
+@want = ('test 13 0', 5);
is_deeply(
- \@want,
\@got,
+ \@want,
'increments the first integer with point at position 6'
);
-@want = incdec::incdec('test 19 0', 1, 6);
-@got = ('test 20 0', 5);
+@got = incdec::incdec('test 19 0', 1, 6);
+@want = ('test 20 0', 5);
is_deeply(
- \@want,
\@got,
+ \@want,
'increments the first integer with point at position 6'
);
-@want = incdec::incdec('test 12 0', 1, 7);
-@got = ('test 12 1', 8);
+@got = incdec::incdec('test 12 0', 1, 7);
+@want = ('test 12 1', 8);
is_deeply(
- \@want,
\@got,
+ \@want,
'increments the second integer with point at position 7'
);
-@want = incdec::incdec('test 12 19 555', 1, 9);
-@got = ('test 12 20 555', 8);
+@got = incdec::incdec('test 12 19 555', 1, 9);
+@want = ('test 12 20 555', 8);
is_deeply(
- \@want,
\@got,
+ \@want,
'increments the second double-digit integer with point at position 9'
);
-@want = incdec::incdec('test 12 19 555', 1, 12);
-@got = ('test 12 19 556', 11);
+@got = incdec::incdec('test 12 19 555', 1, 12);
+@want = ('test 12 19 556', 11);
is_deeply(
- \@want,
\@got,
+ \@want,
'increments the third triple-digit integer with point at position 12'
);
-@want = incdec::incdec('test 12 19 555', 7, 9);
-@got = ('test 12 26 555', 8);
+@got = incdec::incdec('test 12 19 555', 7, 9);
+@want = ('test 12 26 555', 8);
is_deeply(
- \@want,
\@got,
+ \@want,
'increments the second double-digit integer by 7 with point at position 9'
);
-@want = incdec::incdec('test 12 19 555 64', 1, 16);
-@got = ('test 12 19 555 65', 15);
+@got = incdec::incdec('test 12 19 555 64', 1, 16);
+@want = ('test 12 19 555 65', 15);
is_deeply(
- \@want,
\@got,
+ \@want,
'increments the fourth double-digit integer with point at position 16'
);
-@want = incdec::incdec('test 12 19 555 64', 1, 17, 1);
-@got = ('test 12 19 555 65', 15);
+@got = incdec::incdec('test 12 19 555 64', 1, 17, 1);
+@want = ('test 12 19 555 65', 15);
is_deeply(
- \@want,
\@got,
+ \@want,
'increments the fourth double-digit integer with point at position 17 backward'
);
-@want = incdec::incdec('test 12 19 555 64', 1, 13, 1);
-@got = ('test 12 19 556 64', 11);
+@got = incdec::incdec('test 12 19 555 64', 1, 13, 1);
+@want = ('test 12 19 556 64', 11);
is_deeply(
- \@want,
\@got,
+ \@want,
'increments the third triple-digit integer with point at position 13 backward'
);
-@want = incdec::incdec('test 12 19 555 64', 1, 14, 1);
-@got = ('test 12 19 556 64', 11);
+@got = incdec::incdec('test 12 19 555 64', 1, 14, 1);
+@want = ('test 12 19 556 64', 11);
is_deeply(
- \@want,
\@got,
+ \@want,
'increments the third triple-digit integer with point at position 14 backward'
);
-@want = incdec::incdec('test 12 982 4 ', 1, 14, 1);
-@got = ('test 12 982 5 ', 12);
+@got = incdec::incdec('test 12 982 4 ', 1, 14, 1);
+@want = ('test 12 982 5 ', 12);
is_deeply(
- \@want,
\@got,
+ \@want,
'increments the third integer with point at position 14 backward'
);
-@want = incdec::incdec('test -1 ', 1, 7, 1);
-@got = ('test 0 ', 5);
+@got = incdec::incdec('test -1 ', 1, 7, 1);
+@want = ('test 0 ', 5);
is_deeply(
- \@want,
\@got,
+ \@want,
'increments the negative integer with point at position 7 backward'
);
-@want = incdec::incdec('test -1 ', -1, 7, 1);
-@got = ('test -2 ', 5);
+@got = incdec::incdec('test -1 ', -1, 7, 1);
+@want = ('test -2 ', 5);
is_deeply(
- \@want,
\@got,
+ \@want,
'decrements the negative integer with point at position 7 backward'
);
-@want = incdec::incdec('test 1 -2', 1, 8, 1);
-@got = ('test 1 -1', 7);
+@got = incdec::incdec('test 1 -2', 1, 8, 1);
+@want = ('test 1 -1', 7);
is_deeply(
- \@want,
\@got,
+ \@want,
'increments the second negative integer with point at position 8 backward'
);
-@want = incdec::incdec('test 1 -2', -1, 8, 1);
-@got = ('test 1 -3', 7);
+@got = incdec::incdec('test 1 -2', -1, 8, 1);
+@want = ('test 1 -3', 7);
is_deeply(
- \@want,
\@got,
+ \@want,
'decrements the second negative integer with point at position 8 backward'
);
-@want = incdec::incdec('test 12', -1);
-@got = ('test 11', 5);
+@got = incdec::incdec('test 12', -1);
+@want = ('test 11', 5);
is_deeply(
- \@want,
\@got,
+ \@want,
'decrements the first integer'
);
-@want = incdec::incdec('test 12', -1, 7, 1);
-@got = ('test 11', 5);
+@got = incdec::incdec('test 12', -1, 7, 1);
+@want = ('test 11', 5);
is_deeply(
- \@want,
\@got,
+ \@want,
'decrements the first integer with point at position 7 backward'
);
-@want = incdec::incdec('test 12 982 4', -1, 11, 1);
-@got = ('test 12 981 4', 8);
+@got = incdec::incdec('test 12 982 4', -1, 11, 1);
+@want = ('test 12 981 4', 8);
is_deeply(
- \@want,
\@got,
+ \@want,
'decrements the second integer with point at position 11 backward'
);
-@want = incdec::incdec('test 12 982 4', -1, 9, 1);
-@got = ('test 12 981 4', 8);
+@got = incdec::incdec('test 12 982 4', -1, 9, 1);
+@want = ('test 12 981 4', 8);
is_deeply(
- \@want,
\@got,
+ \@want,
'decrements the second integer with point at position 9 backward'
);
-@want = incdec::incdec('test 12 982 4', -5, 8, 1);
-@got = ('test 12 977 4', 8);
+@got = incdec::incdec('test 12 982 4', -5, 8, 1);
+@want = ('test 12 977 4', 8);
is_deeply(
- \@want,
\@got,
+ \@want,
'decrements the second integer by 5 with point at position 8 backward'
);
-@want = incdec::incdec('test 12 1 4', -2, 9, 1);
-@got = ('test 12 -1 4', 8);
+@got = incdec::incdec('test 12 1 4', -2, 9, 1);
+@want = ('test 12 -1 4', 8);
is_deeply(
- \@want,
\@got,
+ \@want,
'decrements the second integer by 2 with point at position 9 backward'
);
-@want = incdec::incdec("sed -n '39,54p' Alice\'s\ Adventures\ in\ Wonderland.txt ", 1, 3, 1);
-@got = ("sed -n '40,54p' Alice\'s\ Adventures\ in\ Wonderland.txt ", 8);
+@got = incdec::incdec("sed -n '39,54p' Alice\'s\ Adventures\ in\ Wonderland.txt ", 1, 3, 1);
+@want = ("sed -n '40,54p' Alice\'s\ Adventures\ in\ Wonderland.txt ", 8);
is_deeply(
- \@want,
\@got,
+ \@want,
'increments the first integer with point at position 3 backward'
);
-@want = incdec::incdec("sed -n '39,54p' Alice\'s\ Adventures\ in\ Wonderland.txt ", 1, 8, 1);
-@got = ("sed -n '40,54p' Alice\'s\ Adventures\ in\ Wonderland.txt ", 8);
+@got = incdec::incdec("sed -n '39,54p' Alice\'s\ Adventures\ in\ Wonderland.txt ", 1, 8, 1);
+@want = ("sed -n '40,54p' Alice\'s\ Adventures\ in\ Wonderland.txt ", 8);
is_deeply(
- \@want,
\@got,
+ \@want,
'increments the first integer with point at position 8 backward'
);
-@want = incdec::incdec("sed -n '39,54p' Alice\'s\ Adventures\ in\ Wonderland.txt ", -1, 10, 1);
-@got = ("sed -n '38,54p' Alice\'s\ Adventures\ in\ Wonderland.txt ", 8);
+@got = incdec::incdec("sed -n '39,54p' Alice\'s\ Adventures\ in\ Wonderland.txt ", -1, 10, 1);
+@want = ("sed -n '38,54p' Alice\'s\ Adventures\ in\ Wonderland.txt ", 8);
is_deeply(
- \@want,
\@got,
+ \@want,
'decrements the first integer with point at position 10 backward'
);
-@want = incdec::incdec("sed -n '39,54p' Alice\'s\ Adventures\ in\ Wonderland.txt ", 1, 3, 8);
-@got = ("sed -n '40,54p' Alice\'s\ Adventures\ in\ Wonderland.txt ", 8);
+@got = incdec::incdec("sed -n '39,54p' Alice\'s\ Adventures\ in\ Wonderland.txt ", 1, 3, 8);
+@want = ("sed -n '40,54p' Alice\'s\ Adventures\ in\ Wonderland.txt ", 8);
is_deeply(
- \@want,
\@got,
+ \@want,
'increments the first integer with point at position 3'
);