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 878e6bb

Browse files
Create check-if-there-is-a-valid-partition-for-the-array_test.go
1 parent a6a85f5 commit 878e6bb

File tree

1 file changed

+36
-0
lines changed

1 file changed

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

0 commit comments

Comments
(0)

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