add test for round-trip encoding/decoding