Add tests for @a883e14

This was imported from trunk but no tests were added.  Now we have some
nice tests to prevent regeressions.

Fixes #270