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 3a9ef64

Browse files
Create minimum-window-substring_test.go
1 parent 5607eb3 commit 3a9ef64

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

‎minimum-window-substring_test.go‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package leetcode_solutions_golang
2+
3+
import "testing"
4+
5+
func Test_minWindow(t *testing.T) {
6+
type args struct {
7+
s string
8+
t string
9+
}
10+
tests := []struct {
11+
name string
12+
args args
13+
want string
14+
}{
15+
{
16+
name: "test case 1",
17+
args: args{
18+
s: "ADOBECODEBANCD",
19+
t: "ABC",
20+
},
21+
want: "BANC",
22+
},
23+
{
24+
name: "test case 2",
25+
args: args{
26+
s: "AB",
27+
t: "B",
28+
},
29+
want: "B",
30+
},
31+
}
32+
for _, tt := range tests {
33+
t.Run(tt.name, func(t *testing.T) {
34+
if got := minWindow(tt.args.s, tt.args.t); got != tt.want {
35+
t.Errorf("minWindow() = %v, want %v", got, tt.want)
36+
}
37+
})
38+
}
39+
}

0 commit comments

Comments
(0)

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