exercism/xgo — pull request #70 by soniakeys (2014-06-13 04:27:59+00:00)
Title: add exercise ocr numbers

I tried to keep the two-part scheme of the readme, while, of course, changing a few little things here and there. For part one, the test program requires that something is defined but that's all. Instructions are to define a function and then use it as a subroutine but I don't actually check that. I think it would be possible, to read the .exercism file, find and parse the source, and search the AST... but that seemed too much trouble. Easy enough to let nitpickers cry foul if someone doesn't follow directions. The reason for not checking step 1 with the test program is that I didn't want to constrain the function signature. Better to let the solver pick an optimal signature for however they are implementing step 2.

Also I resisted adding test cases for ill-formatted data. I mentioned in the test program instruction comments that it's good to handle ill-formatted data; and the example program does something well defined with ill-formatted data. Adding tests though, even as a separate file with a build tag, would dictate how to handle ill-formed data and I thought there was room for different views.