Add regression test for #315 (already passes)