Test writing