Add test for document write.