Add test suite.

(Shamelessly stolen from @sstephenson.)