Add a test

Viva la testing revolution! As usual, we wanted to have tests from
the start, but didn't until now. And it's much too tedious to add
tests postfactum, so we're going to introduce them once for each
new feature or bug fixed. Still, better late than never.