Skip to content

Commit 194737d

Browse files
committed
Create daily-temperatures_test.go
1 parent cc88f81 commit 194737d

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

daily-temperatures_test.go

+32
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_dailyTemperatures(t *testing.T) {
9+
type args struct {
10+
temperatures []int
11+
}
12+
tests := []struct {
13+
name string
14+
args args
15+
want []int
16+
}{
17+
{
18+
name: "test1",
19+
args: args{
20+
temperatures: []int{73, 74, 75, 71, 69, 72, 76, 73},
21+
},
22+
want: []int{1, 1, 4, 2, 1, 1, 0, 0},
23+
},
24+
}
25+
for _, tt := range tests {
26+
t.Run(tt.name, func(t *testing.T) {
27+
if got := dailyTemperatures(tt.args.temperatures); !reflect.DeepEqual(got, tt.want) {
28+
t.Errorf("dailyTemperatures() = %v, want %v", got, tt.want)
29+
}
30+
})
31+
}
32+
}

0 commit comments

Comments
 (0)