Skip to content

Commit

Permalink
完善测试覆盖率
Browse files Browse the repository at this point in the history
  • Loading branch information
deatil committed Jan 29, 2024
1 parent ef22d0a commit bce146b
Show file tree
Hide file tree
Showing 8 changed files with 831 additions and 8 deletions.
57 changes: 57 additions & 0 deletions datebin/get_data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ func Test_Date(t *testing.T) {
month: 05,
day: 11,
},
{
index: "index-3",
date: "0000-00-00 00:00:00",
year: 0,
month: 0,
day: 0,
},
}

for _, td := range tests {
Expand Down Expand Up @@ -59,6 +66,13 @@ func Test_Time(t *testing.T) {
minute: 28,
second: 11,
},
{
index: "index-3",
date: "0000-00-00 00:00:00",
hour: 0,
minute: 0,
second: 0,
},
}

for _, td := range tests {
Expand Down Expand Up @@ -98,6 +112,16 @@ func Test_Datetime(t *testing.T) {
minute: 28,
second: 11,
},
{
index: "index-3",
date: "0000-00-00 00:00:00",
year: 0,
month: 0,
day: 0,
hour: 0,
minute: 0,
second: 0,
},
}

for _, td := range tests {
Expand Down Expand Up @@ -142,6 +166,17 @@ func Test_DatetimeWithNanosecond(t *testing.T) {
second: 11,
nanosecond: 123,
},
{
index: "index-3",
date: "0000-00-00 00:00:00",
year: 0,
month: 0,
day: 0,
hour: 0,
minute: 0,
second: 0,
nanosecond: 0,
},
}

for _, td := range tests {
Expand Down Expand Up @@ -187,6 +222,17 @@ func Test_DatetimeWithMicrosecond(t *testing.T) {
second: 11,
microsecond: 123,
},
{
index: "index-3",
date: "0000-00-00 00:00:00",
year: 0,
month: 0,
day: 0,
hour: 0,
minute: 0,
second: 0,
microsecond: 0,
},
}

for _, td := range tests {
Expand Down Expand Up @@ -232,6 +278,17 @@ func Test_DatetimeWithMillisecond(t *testing.T) {
second: 11,
millisecond: 123,
},
{
index: "index-3",
date: "",
year: 0,
month: 0,
day: 0,
hour: 0,
minute: 0,
second: 0,
millisecond: 0,
},
}

for _, td := range tests {
Expand Down
24 changes: 24 additions & 0 deletions datebin/get_datetime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,30 @@ func Test_DatetimeAll(t *testing.T) {
ISOYear: 1992,
ISOWeek: 20,
},
{
index: "index-3",
date: "",
century: 0,
decade: 0,
quarter: 0,
weekday: 0,
millisecond: 0,
microsecond: 0,
nanosecond: 0,
timestamp: 0,
timestampWithSecond: 0,
timestampWithMillisecond: 0,
timestampWithMicrosecond: 0,
timestampWithNanosecond: 0,
year: 0,
month: 0,
day: 0,
hour: 0,
minute: 0,
second: 0,
ISOYear: 0,
ISOWeek: 0,
},
}

for _, td := range tests {
Expand Down
Loading

0 comments on commit bce146b

Please sign in to comment.