Skip to content

Commit dd5ed1c

Browse files
authored
Merge branch 'nabil.dakkoune/go-forwarder' into nabil.dakkoune/AWSINTS-3450
2 parents 493ec22 + 690d812 commit dd5ed1c

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

aws/logs_monitoring_go/internal/model/tags_test.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ package model
77

88
import (
99
"encoding/json"
10+
"slices"
1011
"testing"
1112
)
1213

13-
func TestTagsMarshalJSON(t *testing.T) {
14+
func TestTags(t *testing.T) {
1415
t.Parallel()
1516

1617
tests := map[string]struct {
@@ -40,11 +41,20 @@ func TestTagsMarshalJSON(t *testing.T) {
4041
t.Parallel()
4142
got, err := json.Marshal(tc.tags)
4243
if err != nil {
43-
t.Fatalf("unexpected error: %v", err)
44+
t.Fatalf("unexpected marshal error: %v", err)
4445
}
4546
if string(got) != tc.want {
4647
t.Errorf("got %s, want %s", got, tc.want)
4748
}
49+
50+
var tags Tags
51+
err = json.Unmarshal(got, &tags)
52+
if err != nil {
53+
t.Fatalf("unexpected unmarshal error: %v", err)
54+
}
55+
if !slices.Equal(tc.tags, tags) {
56+
t.Errorf("expected %v, got %v", tc.tags, tags)
57+
}
4858
})
4959
}
5060
}

0 commit comments

Comments
 (0)