provide a test case for and code from #195

Thanks to @waywaaard for the initial code.