add tests for #383 solution