tests: add tests for bug #47