Add test_write