From 042f8eb204ff322798e9f0ab66115a358c5b96ac Mon Sep 17 00:00:00 2001 From: "Nicolas S. Dade" Date: Wed, 7 Mar 2018 03:26:27 -0800 Subject: [PATCH] reduce the unit test map to 1 element so the encoding is consistent otherwise, since the map iterates in randomish order, some of the time the element order does not match the unit test expected result, causing the unit test to fail unnecessarily. --- tests/custom_map_key_type.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/custom_map_key_type.go b/tests/custom_map_key_type.go index e5cc32e..099bd06 100644 --- a/tests/custom_map_key_type.go +++ b/tests/custom_map_key_type.go @@ -22,9 +22,8 @@ var customMapKeyTypeValue CustomMapKeyType func init() { customMapKeyTypeValue.Map = map[customKeyType]int{ - customKeyType{0x01, 0x01}: 1, - customKeyType{0x02, 0x02}: 2, + customKeyType{0x01, 0x02}: 3, } } -var customMapKeyTypeValueString = `{"Map":{"0101":1,"0202":2}}` +var customMapKeyTypeValueString = `{"Map":{"0102":3}}`