test for bytesref stubstring function

provide an error message for IllegalArgumentException