Skip to content

Commit

Permalink
Fix issue #246
Browse files Browse the repository at this point in the history
  • Loading branch information
gouguoyin committed Oct 11, 2024
1 parent 6ab54e7 commit 4235ed0
Showing 1 changed file with 0 additions and 43 deletions.
43 changes: 0 additions & 43 deletions calendar/lunar/lunar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1772,46 +1772,3 @@ func TestLunar_IsPigYear(t *testing.T) {
})
}
}

// https://github.com/golang-module/carbon/issues/246
func TestCarbon_Issue246(t *testing.T) {
type args struct {
g Gregorian
}
tests := []struct {
name string
args args
want string
}{
{
name: "case1",
args: args{FromGregorian(time.Date(2024, 9, 21, 0, 0, 0, 0, time.Local))},
want: "2024-08-19 00:00:00",
},
{
name: "case2",
args: args{FromGregorian(time.Date(2024, 9, 21, 23, 50, 0, 0, time.Local))},
want: "2024-08-19 23:50:00",
},
{
name: "case3",
args: args{FromGregorian(time.Date(2024, 9, 21, 23, 54, 0, 0, time.Local))},
want: "2024-08-19 23:54:00",
},
{
name: "case4",
args: args{FromGregorian(time.Date(2024, 9, 21, 23, 55, 0, 0, time.Local))},
want: "2024-08-19 23:55:00",
},
{
name: "case5",
args: args{FromGregorian(time.Date(2024, 9, 21, 23, 59, 0, 0, time.Local))},
want: "2024-08-19 23:59:00",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
assert.Equalf(t, tt.want, (tt.args.g).ToLunar().String(), "args{%v}", tt.args.g)
})
}
}

0 comments on commit 4235ed0

Please sign in to comment.