test that failure is due to expected error