test: add additional tests

main
olimorris 2022-03-08 20:23:16 +00:00
parent 1c465857f1
commit 254663b3ce
1 changed files with 26 additions and 0 deletions

View File

@ -35,4 +35,30 @@ describe("With default settings:", function()
assert.equals(content[1], "This is a test file") assert.equals(content[1], "This is a test file")
assert.equals(vim.g.persisting, true) assert.equals(vim.g.persisting, true)
end) end)
it("stops a session", function()
require("persisted").stop()
assert.equals(vim.g.persisting, false)
end)
it("starts a session", function()
require("persisted").start()
assert.equals(vim.g.persisting, true)
end)
it("lists sessions", function()
local sessions = require("persisted").list()
local path = require("plenary.path"):new(sessions[1])
assert.equals(path:is_path(), true)
end)
it("deletes a session", function()
require("persisted").delete()
assert.equals(vim.fn.system("ls tests/data | wc -l"), "0\n")
end)
end) end)