Skip to content

Commit

Permalink
Add tests for BeginningOfMonth and BeginningOfYear
Browse files Browse the repository at this point in the history
  • Loading branch information
yaa110 committed Nov 11, 2019
1 parent 32373f1 commit cb9e20b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ptime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,14 @@ func TestFirstLast(t *testing.T) {
)
}

if ti.BeginningOfMonth().Weekday() != Charshanbeh {
t.Error(
"For", "BeginningOfMonth().Weekday()",
"expected", Charshanbeh.String(),
"got", ti.BeginningOfMonth().Weekday(),
)
}

if ti.LastMonthDay().Weekday() != Panjshanbeh {
t.Error(
"For", "LastMonthDay().Weekday()",
Expand All @@ -352,6 +360,14 @@ func TestFirstLast(t *testing.T) {
)
}

if ti.BeginningOfYear().Weekday() != Shanbeh {
t.Error(
"For", "BeginningOfYear().Weekday()",
"expected", Shanbeh.String(),
"got", ti.BeginningOfYear().Weekday(),
)
}

if ti.LastYearDay().Weekday() != Shanbeh {
t.Error(
"For", "LastYearDay().Weekday()",
Expand Down

0 comments on commit cb9e20b

Please sign in to comment.