Test writing a string.