cast_from_char test improved