feat: rename
This commit is contained in:
parent
c69a3957c8
commit
78a275d096
21 changed files with 191 additions and 191 deletions
|
|
@ -1,16 +1,16 @@
|
|||
require('spec.helpers')
|
||||
|
||||
local config = require('todo.config')
|
||||
local store = require('todo.store')
|
||||
local config = require('pending.config')
|
||||
local store = require('pending.store')
|
||||
|
||||
describe('diff', function()
|
||||
local tmpdir
|
||||
local diff = require('todo.diff')
|
||||
local diff = require('pending.diff')
|
||||
|
||||
before_each(function()
|
||||
tmpdir = vim.fn.tempname()
|
||||
vim.fn.mkdir(tmpdir, 'p')
|
||||
vim.g.todo = { data_path = tmpdir .. '/tasks.json' }
|
||||
vim.g.pending = { data_path = tmpdir .. '/tasks.json' }
|
||||
config.reset()
|
||||
store.unload()
|
||||
store.load()
|
||||
|
|
@ -18,7 +18,7 @@ describe('diff', function()
|
|||
|
||||
after_each(function()
|
||||
vim.fn.delete(tmpdir, 'rf')
|
||||
vim.g.todo = nil
|
||||
vim.g.pending = nil
|
||||
config.reset()
|
||||
end)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
require('spec.helpers')
|
||||
|
||||
local config = require('todo.config')
|
||||
local config = require('pending.config')
|
||||
|
||||
describe('parse', function()
|
||||
before_each(function()
|
||||
vim.g.todo = nil
|
||||
vim.g.pending = nil
|
||||
config.reset()
|
||||
end)
|
||||
|
||||
after_each(function()
|
||||
vim.g.todo = nil
|
||||
vim.g.pending = nil
|
||||
config.reset()
|
||||
end)
|
||||
|
||||
local parse = require('todo.parse')
|
||||
local parse = require('pending.parse')
|
||||
|
||||
describe('body', function()
|
||||
it('returns plain description when no metadata', function()
|
||||
|
|
@ -73,7 +73,7 @@ describe('parse', function()
|
|||
end)
|
||||
|
||||
it('uses configurable date syntax', function()
|
||||
vim.g.todo = { date_syntax = 'by' }
|
||||
vim.g.pending = { date_syntax = 'by' }
|
||||
config.reset()
|
||||
local desc, meta = parse.body('Buy milk by:2026-03-15')
|
||||
assert.are.equal('Buy milk', desc)
|
||||
|
|
@ -81,7 +81,7 @@ describe('parse', function()
|
|||
end)
|
||||
|
||||
it('ignores old syntax when date_syntax is changed', function()
|
||||
vim.g.todo = { date_syntax = 'by' }
|
||||
vim.g.pending = { date_syntax = 'by' }
|
||||
config.reset()
|
||||
local desc, meta = parse.body('Buy milk due:2026-03-15')
|
||||
assert.are.equal('Buy milk due:2026-03-15', desc)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
require('spec.helpers')
|
||||
|
||||
local config = require('todo.config')
|
||||
local store = require('todo.store')
|
||||
local config = require('pending.config')
|
||||
local store = require('pending.store')
|
||||
|
||||
describe('store', function()
|
||||
local tmpdir
|
||||
|
|
@ -9,14 +9,14 @@ describe('store', function()
|
|||
before_each(function()
|
||||
tmpdir = vim.fn.tempname()
|
||||
vim.fn.mkdir(tmpdir, 'p')
|
||||
vim.g.todo = { data_path = tmpdir .. '/tasks.json' }
|
||||
vim.g.pending = { data_path = tmpdir .. '/tasks.json' }
|
||||
config.reset()
|
||||
store.unload()
|
||||
end)
|
||||
|
||||
after_each(function()
|
||||
vim.fn.delete(tmpdir, 'rf')
|
||||
vim.g.todo = nil
|
||||
vim.g.pending = nil
|
||||
config.reset()
|
||||
end)
|
||||
|
||||
|
|
@ -37,14 +37,14 @@ describe('store', function()
|
|||
tasks = {
|
||||
{
|
||||
id = 1,
|
||||
description = 'Todo one',
|
||||
description = 'Pending one',
|
||||
status = 'pending',
|
||||
entry = '2026-01-01T00:00:00Z',
|
||||
modified = '2026-01-01T00:00:00Z',
|
||||
},
|
||||
{
|
||||
id = 2,
|
||||
description = 'Todo two',
|
||||
description = 'Pending two',
|
||||
status = 'done',
|
||||
entry = '2026-01-01T00:00:00Z',
|
||||
modified = '2026-01-01T00:00:00Z',
|
||||
|
|
@ -55,7 +55,7 @@ describe('store', function()
|
|||
local data = store.load()
|
||||
assert.are.equal(3, data.next_id)
|
||||
assert.are.equal(2, #data.tasks)
|
||||
assert.are.equal('Todo one', data.tasks[1].description)
|
||||
assert.are.equal('Pending one', data.tasks[1].description)
|
||||
assert.are.equal('done', data.tasks[2].status)
|
||||
end)
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ describe('store', function()
|
|||
tasks = {
|
||||
{
|
||||
id = 1,
|
||||
description = 'Todo',
|
||||
description = 'Pending',
|
||||
status = 'pending',
|
||||
entry = '2026-01-01T00:00:00Z',
|
||||
modified = '2026-01-01T00:00:00Z',
|
||||
|
|
@ -157,7 +157,7 @@ describe('store', function()
|
|||
tasks = {
|
||||
{
|
||||
id = 1,
|
||||
description = 'Todo',
|
||||
description = 'Pending',
|
||||
status = 'pending',
|
||||
entry = '2026-01-01T00:00:00Z',
|
||||
modified = '2026-01-01T00:00:00Z',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue