-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_test.go
46 lines (44 loc) · 1.08 KB
/
main_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package main
import (
"testing"
)
func TestToUnixTimeFromString(t *testing.T) {
tests := []struct {
name string
}{
{name: "2023/06/0121:00"},
{name: "2023/07/0121:00"},
{name: "2023/08/0121:00"},
{name: "2023/09/0121:00"},
{name: "2023/10/0121:00"},
}
for _, tt := range tests {
got := ToUnixTimeFromString(tt.name)
//t.Errorf("ToJstTimeFromString() = %v, want %v", got, tt.name)
t.Logf("ToUnixTimeFromString() got= %v, want= %v", got, tt.name)
// t.Run(tt.name, func(t *testing.T) {
// ToUnixTimeFromString(tt.name)
// })
}
}
func TestToJstTimeFromString(t *testing.T) {
tests := []struct {
name string
}{
{name: "2023/01/0121:00"},
{name: "2023/02/0121:00"},
{name: "2023/03/0121:00"},
{name: "2023/04/0121:00"},
{name: "2023/05/0121:00"},
}
for _, tt := range tests {
got := ToJstTimeFromString(tt.name)
if got.Month() != 3 {
//t.Errorf("ToJstTimeFromString() = %v, want %v", got, tt.name)
t.Logf("ToJstTimeFromString() got= %v, want= %v", got, tt.name)
}
// t.Run(tt.name, func(t *testing.T) {
// ToJstTimeFromString(tt.name)
// })
}
}