T'was line endings and redundant spaces, fixed with a strip(), but as I say, Java's asserts are better to noobs.
Here's the test: https://gist.github.com/paul-hammant/058161485a227299e5d7c34cc6a33264 I had to refactor the actual script too. A tiny backwards-compatible bit. -ph