Skip to content

Commit

Permalink
a better name
Browse files Browse the repository at this point in the history
  • Loading branch information
kentquirk committed Aug 30, 2024
1 parent 5388e74 commit a2da022
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions config/sampler_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ func anys(a ...any) []any {

func Test_setInBasedOperators(t *testing.T) {
tests := []struct {
name string
datatype string
testvalue any
value any
wantResult bool
wantErr bool
name string
datatype string
testvalue any
value any
shouldContain bool
wantErr bool
}{
// we want to test many different combinations of datatypes and conditions
// datatypes: string, int, float, bool, for all 3 of datatype, value, testvalue
Expand Down Expand Up @@ -157,8 +157,8 @@ func Test_setInBasedOperators(t *testing.T) {
}
if err == nil {
result := rbsc.Matches(tt.testvalue, true)
if result != tt.wantResult {
t.Errorf("setCompareOperators() result = %v, wantResult %v", result, tt.wantResult)
if result != tt.shouldContain {
t.Errorf("setCompareOperators() result = %v, shouldContain %v", result, tt.shouldContain)
}
}
// test NotIn
Expand All @@ -169,8 +169,8 @@ func Test_setInBasedOperators(t *testing.T) {
if err == nil {
result := rbsc.Matches(tt.testvalue, true)
// opposite result
if result != !tt.wantResult {
t.Errorf("setCompareOperators() result = %v, wantResult %v", result, !tt.wantResult)
if result != !tt.shouldContain {
t.Errorf("setCompareOperators() result = %v, should not Contain %v", result, !tt.shouldContain)
}
}
})
Expand Down

0 comments on commit a2da022

Please sign in to comment.