Add test for writing complex numbers