unit test for #2815, as requested by @brendandburns