added test case for #865