Files
LeetCode-Go/leetcode/1178.Number-of-Valid-Words-for-Each-Puzzle/1178. Number of Valid Words for Each Puzzle_test.go
2021-03-04 03:34:47 +08:00

33 lines
747 B
Go

package leetcode
import (
"reflect"
"testing"
)
func Test_findNumOfValidWords(t *testing.T) {
words1 := []string{"aaaa", "asas", "able", "ability", "actt", "actor", "access"}
puzzles1 := []string{"aboveyz", "abrodyz", "abslute", "absoryz", "actresz", "gaswxyz"}
type args struct {
words []string
puzzles []string
}
tests := []struct {
name string
args args
want []int
}{
// TODO: Add test cases.
{"1", args{words: words1, puzzles: puzzles1}, []int{1, 1, 3, 2, 4, 0}},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := findNumOfValidWords(tt.args.words, tt.args.puzzles); !reflect.DeepEqual(got, tt.want) {
t.Errorf("findNumOfValidWords() = %v, want %v", got, tt.want)
}
})
}
}