fix: correct buffer parser and timestamp test
Problem: parse_buffer classified /id/-prefixed task lines as headers because '/' matches the '^%S' header pattern. Store timestamp test was flaky when add and update ran within the same second. Solution: check for task line patterns (id prefix or 2-space indent) before falling through to the header branch. Backdate the initial modified timestamp in the store update test.
This commit is contained in:
parent
6cb5ae9dda
commit
edd16f6ecf
2 changed files with 25 additions and 27 deletions
|
|
@ -106,11 +106,11 @@ describe('store', function()
|
|||
it('updates fields and sets modified', function()
|
||||
store.load()
|
||||
local t = store.add({ description = 'Original' })
|
||||
local original_modified = t.modified
|
||||
t.modified = '2025-01-01T00:00:00Z'
|
||||
store.update(t.id, { description = 'Updated' })
|
||||
local updated = store.get(t.id)
|
||||
assert.are.equal('Updated', updated.description)
|
||||
assert.is_not.equal(original_modified, updated.modified)
|
||||
assert.is_not.equal('2025-01-01T00:00:00Z', updated.modified)
|
||||
end)
|
||||
|
||||
it('sets end timestamp on completion', function()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue