i forgot something

This commit is contained in:
2025-12-24 02:28:26 +03:00
parent baf5e9d0cd
commit 227e2aae51
2 changed files with 66 additions and 0 deletions

42
util_test.go Normal file
View File

@@ -0,0 +1,42 @@
package parser
import "testing"
func TestContainsWord(t *testing.T) {
tests := []struct {
input []string
want bool
}{
{
[]string{
"card-header card",
"card",
},
true,
},
{
[]string{
"card-body card-header",
"card-header",
},
true,
},
{
[]string{
"card-body card-header",
"card",
},
false,
},
}
for _, test := range tests {
got := containsWord(
test.input[0],
test.input[1],
)
if got != test.want {
t.Errorf("got: %t, want %t", got, test.want)
}
}
}