Dr Bean writes:

> I've gotten comfortable with Test::More conventions, but it's
> difficult in my editor to really quickly create lots of tests.

Which editor is that?

> is($o->index('You'), 1, 'objects index 1');
> isnt($o->index(1), 1, 'objects index 2');
> isnt($o->index(2), 2, 'objects index 2');
> is($o->index($t), 3, 'objects index 3');
> 
> Incrementing numbers and substituting words and letters takes
> time

If your editor happens to be Vim then be aware that Ctrl+A adds 1 to the
number currently under the cursor, or the next number on the current
line if the cursor isn't on a number.

That means that if you press Enter to move on to a line (so the cursor
is at the start of it) Ctrl+A will increment the first number (or if
you're already on the line, press 0 first to move to the start of it).

And if there's a second number you wish to increment on the same line
then simply press l to move to the right of the first number (which the
cursor will have moved to on pressing Ctrl+A the first time) and then
press Ctrl+A again.

If you're doing this a lot then you can use q to record a keyboard macro
for processing one line and moving on to the next, then it's just a case
of holding down the @ key to do as many lines as you want.

Smylers

Reply via email to