yi-editor/yi — pull request #498 by benarmston (2014-01-19 21:29:11+00:00)
Title: Improve vim2 keymap tests

This MR improves the tests for the Vim2 keymap in a number of ways.

### It adds tests for some of the ex command parsers.

These tests are in `Vim2.TestExCommandParsers` and test two things. That each
parser parses the strings which it should, and that the expected `ExCommand`
is selected for each string by `stringToExCommand`. Or in other words the
parsers parse what they should and don't parse too much.

### It adds tests for operations on something other than a single buffer.

The tests run by `TestVim` only test the interaction of an operation (or
sequence of operations) with the content of a single buffer. Whilst the
mechanism for writing those tests is very nice, it doesn't provide a mechanism
for writing tests which operate on multiple buffers, or operate on some editor
component other than a buffer.

For testing operations that aren't easily tested by `TestVim`, I've created a
new module `Vim2.TestPureEditorManipulations`, which creates a test group from
the various (currently one) tests under `Vim2.EditorManipulations`. The tests
under `Vim2.EditorManipulations` can make use of the utility test functions
defined in `Vim2.TestUtils`. In particular they should use the `runTest`
function which encourages separating tests into setup actions, pre-condition
assertions, test actions and finally post-condition assertions.

### Minor refactoring of TestVim

I've moved the module `TestVim` to `Vim2.TestPureBufferManipulations`, and
refactored its `mkTestCase` function to use the utilties from `Vim2.TestUtils`
(which were originally taken from this module).

### Switched to Tasty for the framework.

I've also switched the test framework from test-framework to tasty. This was
done after I noticed that ethercrow had done so in his rope refactoring
branch. So we seem to be heading in that direction anyway.