Skip to content

Commit

Permalink
add test cases for "dec-2031" and "2031-dec"
Browse files Browse the repository at this point in the history
  • Loading branch information
ijt committed Jan 17, 2023
1 parent cce23a4 commit e245739
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions v2/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,26 @@ func Test_parseImplicitRange(t *testing.T) {
wantR: truncateMonth(time.Date(2022, 12, 1, 0, 0, 0, 0, time.UTC)),
wantParsed: "december",
},
{
name: "my date with dash",
args: args{
s: "dec-2031",
now: time.Time{},
dir: Future,
},
wantR: truncateMonth(time.Date(2031, 12, 1, 0, 0, 0, 0, time.UTC)),
wantParsed: "dec-2031",
},
{
name: "ym date with dash",
args: args{
s: "2031-dec",
now: time.Time{},
dir: Future,
},
wantR: truncateMonth(time.Date(2031, 12, 1, 0, 0, 0, 0, time.UTC)),
wantParsed: "2031-dec",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit e245739

Please sign in to comment.