add a test for to-bytes