provide a test case for and code from #195

Thanks to @waywaard for the initial code.