aboutsummaryrefslogtreecommitdiffstats
path: root/t
AgeCommit message (Collapse)Author
2021-09-07100-increment-decrement: Swap "want" and "got"Teddy Wing
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.
2021-08-28100-increment-decrement: Want to return real start position from incdecTeddy Wing
In order to set up point moving only when point is on or after the start position of the changed number, I want the second return value from `incdec()` to always give me the correct start position. Currently, it returns 0 as the start position when backwards is on and point is before the first number. It should return the start position of the first number.
2021-08-28incdec.pm: Return both line and start positionTeddy Wing
I want access to the start position of the number being operated on. This will allow me to determine if point should be moved or not. Refactor everything to accept an array from `incdec()`.
2021-08-28incdec.pm: Fix an issue where first number wasn't incremented backwardsTeddy Wing
When `$start_position` was 0 going backwards, the `sed` test command line failed to increment the first number in the line. Can't figure out exactly what was wrong, but there seemed to be a problem with using the `\G` assertion for that test case. Decided to remove `\G` when `$start_position` position is 0 to work around the problem. Not sure if there's a more concise solution to this that wouldn't require me to have two separate subtitution lines. Also simplified the substitution regular expression. It turns out I didn't need the first capture group, and it was incorrect in matching /[^-\d]*/ because we really wanted /(?!-?\d+)/, not either or of the characters in the group. Completely removing it still allows everything to work. Don't remember if I added that when I was still using the substringing algorithm, but whatever happens, it's not necessary now.
2021-08-28100-increment-decrement: Add failing test for backward first numberTeddy Wing
When point is before the first number, that number should be incremented or decremented. This doesn't work correctly with more complex, real world commands.
2021-08-24Add license (GNU GPLv3+)Teddy Wing
2021-08-22100-increment-decrement: Add new second number negative integer testsTeddy Wing
The previous negative integer tests worked, but it turns out that when the negative integer isn't the first one, there's a problem.
2021-08-21100-increment-decrement: Add test to decrement a negative integerTeddy Wing
2021-08-21100-increment-decrement: Doesn't work for negative numbersTeddy Wing
Our pattern matcher doesn't increment or decrement negative numbers because it doesn't look for a "-" prefix.
2021-08-19100-increment-decrement: Add a few new test casesTeddy Wing
2021-08-19incdec: Add increment step argumentTeddy Wing
A new subrouting argument that defines by how much the number should be incremented, or decremented if a negative step value is given. Add a few new tests to verify the decrementing behaviour. The final test where point is in the middle of the number fails.
2021-08-19100-increment-decrement: Fix test nameTeddy Wing
2021-08-19incdec: Get backward incrementing working in all casesTeddy Wing
Set up the proper condition to get the start index of the number just before point.
2021-08-19incdec: Get backward incrementing working in middle of a numberTeddy Wing
2021-08-19incdec: Get backward-search incrementing working for last numberTeddy Wing
Doesn't work for middle numbers yet.
2021-08-15incdec: Correctly handle middle-of-number point for third numberTeddy Wing
We were previously using values specific to the first and second numbers in the line. Get middle-of-number point handling working for the third number in the line, and hopefully the rest as well.
2021-08-15100-increment-decrement: Test middle-of-number point for third numberTeddy Wing
Test fails. Increments the second number instead of the third.
2021-08-08100-increment-decrement: Need to handle cursor within for subsequent #sTeddy Wing
Currently, the 'cursor within number' handling only works when the cursor is inside the first number. It needs to work for any number in the line.
2021-08-08incdec: Test for cursor point in between a numberTeddy Wing
Add a failing test for incrementing a number when the cursor is at: test 19 0 ^ This currently results in: test 110 0 which is incorrect.
2021-08-08incdec.pm: Add some tests and ideas for incrementing substringsTeddy Wing
Substrings and direction.
2021-08-08Add a Perl module for performing the actionTeddy Wing
This allows us to more easily test the functionality and add new behaviours.