Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
Signed-off-by: Yuri Shkuro <github@ysh.us>
  • Loading branch information
yurishkuro committed Jul 14, 2024
1 parent 7ac4f29 commit ed06321
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions cmd/jaeger/internal/extension/remotesampling/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,18 @@ func Test_Unmarshal(t *testing.T) {
expectedErr: "",
},
{
name: "Empty config",
input: map[string]any{},
expectedCfg: &Config{
File: nil,
Adaptive: nil,
HTTP: nil,
GRPC: nil,
},
name: "Empty config",
input: map[string]any{},
expectedCfg: &Config{},
expectedErr: "",
},
{
name: "Invalid config",
input: map[string]any{
"foo": "bar",
},
expectedErr: "invalid keys: foo", // sensitive to lib implementation
},
}

for _, tt := range tests {
Expand All @@ -125,7 +127,7 @@ func Test_Unmarshal(t *testing.T) {
require.NoError(t, err)
assert.Equal(t, tt.expectedCfg, &cfg)
} else {
assert.EqualError(t, err, tt.expectedErr)
assert.ErrorContains(t, err, tt.expectedErr)
}
})
}
Expand Down

0 comments on commit ed06321

Please sign in to comment.