Skip to content

Commit

Permalink
Adding more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
waynec86 authored and Tieske committed Sep 6, 2023
1 parent a342408 commit 8566b5f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spec/date_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,15 @@ describe("Testing the 'date' module", function()
assert(date("1976-W01-1 13:00+01:00")==date(1975,12,29,12))
assert(date("1976-W01-1 0700-0500 ")==date(1975,12,29,12))

-- timezone offset with colon
assert(date("2023-08-22T17:40:23.308574-05:00")==date(2023,08,22,22,40,23.308574000))
-- timezone offset without colon
assert(date("2023-08-22T17:40:23.308574-0500")==date(2023,08,22,22,40,23.308574000))
-- timezone offset without minutes
assert(date("2023-08-22T17:40:23.308574-05")==date(2023,08,22,22,40,23.308574000))
-- timezone offset without colon with positive offset and non-zero minutes
assert(date("2023-08-22T19:40:23.308574+08:45")==date(2023,08,22,10,55,23.308574000))
-- timezone offset without colon with no decimal seconds
assert(date("2023-08-22T19:40:23-09:30")==date(2023,08,23,5,10,23))

local a = date(2006, 8, 13) assert(a == date("Sun Aug 13 2006"))
Expand Down

0 comments on commit 8566b5f

Please sign in to comment.