Wrote a non-working unit test for the pattern matcher.
Passed the pattern matching test, and started doing calculated-versus-expected comparisons in the test harness rather than merely logging and eyeballing.