Skip to content

Commit

Permalink
Ensure tags are always marshalled the same way
Browse files Browse the repository at this point in the history
This added check ensures it's always alphabetically ordered when
marshalled.
  • Loading branch information
otoolep committed Jun 10, 2015
1 parent cd3e758 commit 98d315b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tsdb/meta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ func TestMarshalTags(t *testing.T) {
tags: map[string]string{"foo": "bar", "baz": "battttt"},
result: []byte(`baz|foo|battttt|bar`),
},
{
tags: map[string]string{"baz": "battttt", "foo": "bar"},
result: []byte(`baz|foo|battttt|bar`),
},
} {
result := marshalTags(tt.tags)
if !bytes.Equal(result, tt.result) {
Expand Down

0 comments on commit 98d315b

Please sign in to comment.