rwaldron/johnny-five — pull request #228 by tdd (2013-09-12 13:37:48+00:00)
Title: Test suite (~50%) for LCD + LCD fixes on special char processing

Hey Rick,

So I checked your recent patches, and although the whole Words parser thing seemed quite overkill, the examples now worked, so I didn't touch it at first.

I went ahead and created a test suite for the LCD module, and this is when I discovered your code b0rked on several use cases. The common denominator was : special sequence *not* starting the string but immediately followed by non-whitespace regular text. Still, as the existing code broke and I was convinced it could be much shorter, I went ahead and rewrote it in a few lines of regex replacement.

Now all tests pass, so I guess that was a good way to go about it :smile:

I tried and respect the code style (in the lib file, at least), e.g. spaces inside control structure conditions (I dislike that style but hey, your house, your rules), but I added parentheses here and there around assignment-in-conditions to appease JSHint (didn't do it everywhere, probably).

'hope you like it !