Add test for writer.