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 7d386ff

Browse files
Create find-three-consecutive-integers-that-sum-to-a-given-number_test.go
1 parent c5cf823 commit 7d386ff

File tree

1 file changed

+32
-0
lines changed

1 file changed

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

0 commit comments

Comments
(0)

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