ci: format
This commit is contained in:
parent
2482df0f0b
commit
49c93f08fe
2 changed files with 23 additions and 19 deletions
|
|
@ -96,7 +96,10 @@ describe('parse', function()
|
|||
|
||||
it('resolves due:+2d to today plus 2 days', function()
|
||||
local today = os.date('*t') --[[@as osdate]]
|
||||
local expected = os.date('%Y-%m-%d', os.time({ year = today.year, month = today.month, day = today.day + 2 }))
|
||||
local expected = os.date(
|
||||
'%Y-%m-%d',
|
||||
os.time({ year = today.year, month = today.month, day = today.day + 2 })
|
||||
)
|
||||
local desc, meta = parse.body('Task due:+2d')
|
||||
assert.are.equal('Task', desc)
|
||||
assert.are.equal(expected, meta.due)
|
||||
|
|
@ -123,7 +126,10 @@ describe('parse', function()
|
|||
|
||||
it("returns today + 3 days for '+3d'", function()
|
||||
local today = os.date('*t') --[[@as osdate]]
|
||||
local expected = os.date('%Y-%m-%d', os.time({ year = today.year, month = today.month, day = today.day + 3 }))
|
||||
local expected = os.date(
|
||||
'%Y-%m-%d',
|
||||
os.time({ year = today.year, month = today.month, day = today.day + 3 })
|
||||
)
|
||||
local result = parse.resolve_date('+3d')
|
||||
assert.are.equal(expected, result)
|
||||
end)
|
||||
|
|
@ -139,12 +145,12 @@ describe('parse', function()
|
|||
assert.truthy(result:match('^%d%d%d%d%-%d%d%-%d%d$'))
|
||||
end)
|
||||
|
||||
it("returns nil for garbage input", function()
|
||||
it('returns nil for garbage input', function()
|
||||
local result = parse.resolve_date('notadate')
|
||||
assert.is_nil(result)
|
||||
end)
|
||||
|
||||
it("returns nil for empty string", function()
|
||||
it('returns nil for empty string', function()
|
||||
local result = parse.resolve_date('')
|
||||
assert.is_nil(result)
|
||||
end)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue