store: add test cases for hashing of empty inputs (#7004)

This commit is contained in:
Erik Grinaker 2020-08-11 13:10:46 +02:00 committed by GitHub
parent 0f44d1af23
commit 7a0d5ff718
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -18,6 +18,7 @@ func TestMerkleMap(t *testing.T) {
values []string // each string gets converted to []byte in test
want string
}{
{[]string{}, []string{}, ""},
{[]string{"key1"}, []string{"value1"}, "a44d3cc7daba1a4600b00a2434b30f8b970652169810d6dfa9fb1793a2189324"},
{[]string{"key1"}, []string{"value2"}, "0638e99b3445caec9d95c05e1a3fc1487b4ddec6a952ff337080360b0dcc078c"},
// swap order with 2 keys
@ -64,6 +65,7 @@ func TestSimpleMap(t *testing.T) {
values []string // each string gets converted to []byte in test
want string
}{
{[]string{}, []string{}, ""},
{[]string{"key1"}, []string{"value1"}, "a44d3cc7daba1a4600b00a2434b30f8b970652169810d6dfa9fb1793a2189324"},
{[]string{"key1"}, []string{"value2"}, "0638e99b3445caec9d95c05e1a3fc1487b4ddec6a952ff337080360b0dcc078c"},
// swap order with 2 keys