Skip to content

Commit 776119e

Browse files
committed
Refactor test names.
1 parent 69cf189 commit 776119e

6 files changed

+15
-15
lines changed

consts_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"github.com/go-chrono/chrono"
77
)
88

9-
func TestWeekdayString(t *testing.T) {
9+
func TestWeekday_String(t *testing.T) {
1010
for _, tt := range []struct {
1111
day chrono.Weekday
1212
expected string
@@ -32,7 +32,7 @@ func TestWeekdayString(t *testing.T) {
3232
}
3333
}
3434

35-
func TestMonthString(t *testing.T) {
35+
func TestMonth_String(t *testing.T) {
3636
for _, tt := range []struct {
3737
day chrono.Month
3838
expected string

duration_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func TestDurationOf(t *testing.T) {
8484
}
8585
}
8686

87-
func TestDurationUnits(t *testing.T) {
87+
func TestDuration_units(t *testing.T) {
8888
for _, tt := range []struct {
8989
name string
9090
of chrono.Extent
@@ -175,7 +175,7 @@ func TestDurationUnits(t *testing.T) {
175175
}
176176
}
177177

178-
func TestDurationAdd(t *testing.T) {
178+
func TestDuration_Add(t *testing.T) {
179179
for _, tt := range []struct {
180180
name string
181181
d1 chrono.Duration
@@ -306,7 +306,7 @@ func TestDurationAdd(t *testing.T) {
306306
}
307307
}
308308

309-
func TestDurationFormat(t *testing.T) {
309+
func TestDuration_Format(t *testing.T) {
310310
for _, tt := range []struct {
311311
name string
312312
of chrono.Extent
@@ -455,7 +455,7 @@ func TestDurationFormat(t *testing.T) {
455455
}
456456
}
457457

458-
func TestDurationParse(t *testing.T) {
458+
func TestDuration_Parse(t *testing.T) {
459459
for _, tt := range []struct {
460460
name string
461461
input string

extent_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"github.com/go-chrono/chrono"
77
)
88

9-
func TestExtentTruncate(t *testing.T) {
9+
func TestExtent_Truncate(t *testing.T) {
1010
t.Run("positive", func(t *testing.T) {
1111
e := 1*chrono.Hour + 20*chrono.Minute + 5*chrono.Second + 42*chrono.Millisecond + 307*chrono.Microsecond
1212

instant_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ import (
66
chronotest "github.com/go-chrono/chrono/test"
77
)
88

9-
func TestInstantString(t *testing.T) {
9+
func TestInstant_String(t *testing.T) {
1010
i := chronotest.InstantOf(11e14)
1111
if str := i.String(); str != "1100000000000000" {
1212
t.Fatalf("i.String() = %s, want 1100000000000000", str)
1313
}
1414
}
1515

16-
func TestInstantUntil(t *testing.T) {
16+
func TestInstant_Until(t *testing.T) {
1717
i := chronotest.InstantOf(11e14)
1818
d := i.Until(chronotest.InstantOf(12e14))
1919
if nsec := d.Nanoseconds(); nsec != 1e14 {

local_time_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func TestLocalTime(t *testing.T) {
2727
}
2828
}
2929

30-
func TestLocalTimeBusinessHour(t *testing.T) {
30+
func TestLocalTime_BusinessHour(t *testing.T) {
3131
time := chrono.LocalTimeOf(25, 0, 0, 0)
3232

3333
if hour := time.BusinessHour(); hour != 25 {
@@ -39,7 +39,7 @@ func TestLocalTimeBusinessHour(t *testing.T) {
3939
}
4040
}
4141

42-
func TestLocalTimeSub(t *testing.T) {
42+
func TestLocalTime_Sub(t *testing.T) {
4343
for _, tt := range []struct {
4444
t1 chrono.LocalTime
4545
t2 chrono.LocalTime
@@ -56,7 +56,7 @@ func TestLocalTimeSub(t *testing.T) {
5656
}
5757
}
5858

59-
func TestLocalTimeAdd(t *testing.T) {
59+
func TestLocalTime_Add(t *testing.T) {
6060
for _, tt := range []struct {
6161
t chrono.LocalTime
6262
e chrono.Extent
@@ -75,7 +75,7 @@ func TestLocalTimeAdd(t *testing.T) {
7575
}
7676
}
7777

78-
func TestLocalTimeCompare(t *testing.T) {
78+
func TestLocalTime_Compare(t *testing.T) {
7979
for _, tt := range []struct {
8080
name string
8181
t chrono.LocalTime

period_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"github.com/go-chrono/chrono"
77
)
88

9-
func TestPeriodFormat(t *testing.T) {
9+
func TestPeriod_Format(t *testing.T) {
1010
for _, tt := range []struct {
1111
name string
1212
input chrono.Period
@@ -101,7 +101,7 @@ func TestPeriodFormat(t *testing.T) {
101101
}
102102
}
103103

104-
func TestPeriodParse(t *testing.T) {
104+
func TestPeriod_Parse(t *testing.T) {
105105
for _, tt := range []struct {
106106
name string
107107
input string

0 commit comments

Comments
 (0)