Skip to content

Commit

Permalink
Add new test case for gomock.Cond
Browse files Browse the repository at this point in the history
  • Loading branch information
fasmat committed Jun 13, 2024
1 parent 16aecf7 commit f9c8889
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gomock/matchers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ func TestMatchers(t *testing.T) {
[]e{[]string{"a"}, A{"b"}},
},
{"test Cond", gomock.Cond(func(x B) bool { return x.Name == "Dam" }), []e{B{Name: "Dam"}}, []e{B{Name: "Dave"}}},
{"test Cond any", gomock.Cond(func(x any) bool { return x.(B).Name == "Dam" }), []e{B{Name: "Dam"}}, []e{B{Name: "Dave"}}},
{"test Cond wrong type", gomock.Cond(func(x B) bool { return x.Name == "Dam" }), []e{B{Name: "Dam"}}, []e{"Dave"}},
{"test Cond any type", gomock.Cond(func(x any) bool { return x.(B).Name == "Dam" }), []e{B{Name: "Dam"}}, []e{B{Name: "Dave"}}},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit f9c8889

Please sign in to comment.