ids: Add test for ID.Hex

This commit is contained in:
Alex Willmer 2020-04-01 18:56:41 +01:00
parent 63a4915f40
commit 6f111f9dae
1 changed files with 9 additions and 0 deletions

View File

@ -150,3 +150,12 @@ func TestIDUnmarshalJSON(t *testing.T) {
})
}
}
func TestIDHex(t *testing.T) {
id := NewID([32]byte{'a', 'v', 'a', ' ', 'l', 'a', 'b', 's'})
expected := "617661206c61627300000000000000000000000000000000000000000000000000"
actual := id.Hex()
if actual != actual {
t.Fatalf("got %s, expected %s", actual, expected)
}
}