Add unit tests for synopsis parser

We have functional tests, but it would be nice to have unit tests for
certain components too.