test: update unnamed buffer tests for tmpfile fallback
Problem: the unnamed buffer guard tests expected a "no file name"
warning that no longer exists after the tmpfile fallback change.
Solution: update assertions to expect the downstream messages that
unnamed buffers now reach ("no provider configured", "no output file").
This commit is contained in:
parent
c1734eec8f
commit
20f44f44a2
1 changed files with 12 additions and 12 deletions
|
|
@ -126,43 +126,43 @@ describe('preview', function()
|
||||||
return msg
|
return msg
|
||||||
end
|
end
|
||||||
|
|
||||||
it('compile warns on unnamed buffer', function()
|
it('compile falls through to provider check on unnamed buffer', function()
|
||||||
local bufnr = helpers.create_buffer({}, 'typst')
|
local bufnr = helpers.create_buffer({}, 'lua')
|
||||||
local msg = capture_notify(function()
|
local msg = capture_notify(function()
|
||||||
preview.compile(bufnr)
|
preview.compile(bufnr)
|
||||||
end)
|
end)
|
||||||
assert.is_not_nil(msg)
|
assert.is_not_nil(msg)
|
||||||
assert.is_truthy(msg:find('no file name'))
|
assert.is_truthy(msg:find('no provider configured'))
|
||||||
helpers.delete_buffer(bufnr)
|
helpers.delete_buffer(bufnr)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('toggle warns on unnamed buffer', function()
|
it('toggle falls through to provider check on unnamed buffer', function()
|
||||||
local bufnr = helpers.create_buffer({}, 'typst')
|
local bufnr = helpers.create_buffer({}, 'lua')
|
||||||
local msg = capture_notify(function()
|
local msg = capture_notify(function()
|
||||||
preview.toggle(bufnr)
|
preview.toggle(bufnr)
|
||||||
end)
|
end)
|
||||||
assert.is_not_nil(msg)
|
assert.is_not_nil(msg)
|
||||||
assert.is_truthy(msg:find('no file name'))
|
assert.is_truthy(msg:find('no provider configured'))
|
||||||
helpers.delete_buffer(bufnr)
|
helpers.delete_buffer(bufnr)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('clean warns on unnamed buffer', function()
|
it('clean falls through to provider check on unnamed buffer', function()
|
||||||
local bufnr = helpers.create_buffer({}, 'typst')
|
local bufnr = helpers.create_buffer({}, 'lua')
|
||||||
local msg = capture_notify(function()
|
local msg = capture_notify(function()
|
||||||
preview.clean(bufnr)
|
preview.clean(bufnr)
|
||||||
end)
|
end)
|
||||||
assert.is_not_nil(msg)
|
assert.is_not_nil(msg)
|
||||||
assert.is_truthy(msg:find('no file name'))
|
assert.is_truthy(msg:find('no provider configured'))
|
||||||
helpers.delete_buffer(bufnr)
|
helpers.delete_buffer(bufnr)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('open warns on unnamed buffer', function()
|
it('open warns no output on unnamed buffer', function()
|
||||||
local bufnr = helpers.create_buffer({}, 'typst')
|
local bufnr = helpers.create_buffer({}, 'lua')
|
||||||
local msg = capture_notify(function()
|
local msg = capture_notify(function()
|
||||||
preview.open(bufnr)
|
preview.open(bufnr)
|
||||||
end)
|
end)
|
||||||
assert.is_not_nil(msg)
|
assert.is_not_nil(msg)
|
||||||
assert.is_truthy(msg:find('no file name'))
|
assert.is_truthy(msg:find('no output file'))
|
||||||
helpers.delete_buffer(bufnr)
|
helpers.delete_buffer(bufnr)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue