add a testcase for a bug Duncan pointed out.