Skip to content

Instantly share code, notes, and snippets.

@vliubko
Created August 26, 2021 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vliubko/d9c28000b92c8608d65ec01532e83851 to your computer and use it in GitHub Desktop.
Save vliubko/d9c28000b92c8608d65ec01532e83851 to your computer and use it in GitHub Desktop.
package main
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestFindIan(t *testing.T) {
tests := []struct {
give string
wantFound bool
}{
{
give: "ian",
wantFound: true,
},
{
give: "Ian",
wantFound: true,
},
{
give: "IaN",
wantFound: true,
},
{
give: "iuiygaygn",
wantFound: true,
},
{
give: "I d skd a efju N",
wantFound: true,
},
{
give: "ihhhhhn",
wantFound: false,
},
{
give: "ina",
wantFound: false,
},
{
give: "xian",
wantFound: false,
},
}
for _, tt := range tests {
t.Run(tt.give, func(t *testing.T) {
found := findIan(tt.give)
assert.Equal(t, tt.wantFound, found)
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment