test expected exceptions