Mmm… unit tests

I upgraded my old Ruby 1.8.2 install at work to 1.8.6 today. Thank god for unit tests. A good dozen tests of 900 failed, in the code I've churned out over the past year. If I hadn't caught the bugs all right away they would've wreaked havoc. I've learned the hard way never to upgrade anything until / unless there's a good reason to, but I had to do it to Ruby today.

In other news, today I learned the wonders of aw and iw in vim (as opposed to w). Funny how I could use vim for so long and not pick up some of these things which are so obvious and so useful. aw and iw operate on the whole word the cursor is in, forwards and backwards regardless of where in the word your cursor is. (Whereas w goes from the current cursor position forward.) I can think of plenty of times that would've come in handy in the past. Of course there are equivalents that select sentences, the insides of quotes, blocks, paragraphs, etc., all prefixed with a and i.

Tags: ,

3 Responses to “Mmm… unit tests”

  1. Quoth Jason:

    I'm missing something. As soon as you hit a or i, you go into input mode. The only thing either of those commands should do is put a literal ‘w' one character to the right, or in the column your cursor is currently in…

    I know of cw, c$, etc., but I don't understand aw/iw. Nor can I seem to get it to do anything supremely special.

  2. Quoth Brian:

    Oh, iw and aw etc. only work in Visual mode. diw, daw etc. work in Normal mode. See also :h v_a.

  3. Quoth Jason:

    Aha, Visual.
    I don't think I've ever entered that mode except on accident. I've certainly never used it.

    Thanks.

Leave a Reply

You can use these tags in comments (Note: HTML is automatically escaped inside <pre> tags, nowhere else, so if you post source code, put it in <pre>):

<pre lang="some_programming_language"> 
<em>
<strong>
<a href="url">

NOTE: Comments are automatically spam-filtered. If your comment fails to appear, it was likely munched by the filter. Try not to link-spam or post anything that looks like it was typed by a robot.