Skip to content

Commit

Permalink
extend test coverage for assert.Contain
Browse files Browse the repository at this point in the history
  • Loading branch information
adamluzsi committed Sep 17, 2024
1 parent b915aa3 commit 2ef18e1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions assert/Asserter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1137,6 +1137,8 @@ func TestAsserter_Contain_stringHasSub(t *testing.T) {
IsFailed bool
}

type Str string

for _, tc := range []TestCase{
{
Desc: "when doesn't have sub",
Expand All @@ -1162,6 +1164,12 @@ func TestAsserter_Contain_stringHasSub(t *testing.T) {
Sub: "world!",
IsFailed: false,
},
{
Desc: "when string based type has subset of a primite string",
String: Str("foo-bar-baz"),
Sub: "bar",
IsFailed: false,
},
} {
t.Run(tc.Desc, AssertContainsTestCase(tc.String, tc.Sub, tc.IsFailed))
}
Expand Down

0 comments on commit 2ef18e1

Please sign in to comment.