add tests for the code in issue #17