add test for read/write roundtripping