Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit cc086a1

Browse files
Create word-search_test.go
1 parent 3871b8a commit cc086a1

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

‎word-search_test.go‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package leetcode_solutions_golang
2+
3+
import "testing"
4+
5+
func Test_exist(t *testing.T) {
6+
type args struct {
7+
board [][]byte
8+
word string
9+
}
10+
tests := []struct {
11+
name string
12+
args args
13+
want bool
14+
}{
15+
{
16+
name: "test case 1",
17+
args: args{
18+
board: [][]byte{
19+
{'A', 'B', 'C', 'E'},
20+
{'S', 'F', 'C', 'S'},
21+
{'A', 'D', 'E', 'E'},
22+
},
23+
word: "ABCCED",
24+
},
25+
want: true,
26+
},
27+
}
28+
for _, tt := range tests {
29+
t.Run(tt.name, func(t *testing.T) {
30+
if got := exist(tt.args.board, tt.args.word); got != tt.want {
31+
t.Errorf("exist() = %v, want %v", got, tt.want)
32+
}
33+
})
34+
}
35+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /