yi-editor/yi — pull request #544 by jetho (2014-05-15 18:09:42+00:00)
Title: Add optional Settings for Window dependent tests

Hi! For testing window dependent motions like H, M or L, I extended TestPureBufferManipulations.hs with optional settings. An optional setting can be specified at the top of file based test cases by using the --+ prefix.
At the moment, there's only one optional setting defined, WindowSize width height, but it's easy to add new optional settings for other use cases.
By using the WindowSize setting, I'm able to test the H, M and L motions, for example:

--+ WindowSize 12 5
-- Input
(2,3)
aa bb cc dd
aa bb cc dd
aa bb cc dd
aa bb cc dd
aa bb cc dd
aa bb cc dd
aa bb cc dd
-- Output
(4,1)
aa bb cc dd
aa bb cc dd
aa bb cc dd
aa bb cc dd
aa bb cc dd
aa bb cc dd
aa bb cc dd
-- Events
2L

The remaining tests are still working, of course..

That said, I'm still new to the codebase, so I'm not sure if I set up the region correctly. I use

region = mkSizeRegion (Point 0) (Size (w*h))

for creating the region. Please verify if that's the right approach ;-)