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:
Barrett Ruth 2026-02-24 15:19:59 -05:00
parent 6cb5ae9dda
commit edd16f6ecf
2 changed files with 25 additions and 27 deletions

View file

@ -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()