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
|
||||
end
|
||||
|
||||
it('compile warns on unnamed buffer', function()
|
||||
local bufnr = helpers.create_buffer({}, 'typst')
|
||||
it('compile falls through to provider check on unnamed buffer', function()
|
||||
local bufnr = helpers.create_buffer({}, 'lua')
|
||||
local msg = capture_notify(function()
|
||||
preview.compile(bufnr)
|
||||
end)
|
||||
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)
|
||||
end)
|
||||
|
||||
it('toggle warns on unnamed buffer', function()
|
||||
local bufnr = helpers.create_buffer({}, 'typst')
|
||||
it('toggle falls through to provider check on unnamed buffer', function()
|
||||
local bufnr = helpers.create_buffer({}, 'lua')
|
||||
local msg = capture_notify(function()
|
||||
preview.toggle(bufnr)
|
||||
end)
|
||||
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)
|
||||
end)
|
||||
|
||||
it('clean warns on unnamed buffer', function()
|
||||
local bufnr = helpers.create_buffer({}, 'typst')
|
||||
it('clean falls through to provider check on unnamed buffer', function()
|
||||
local bufnr = helpers.create_buffer({}, 'lua')
|
||||
local msg = capture_notify(function()
|
||||
preview.clean(bufnr)
|
||||
end)
|
||||
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)
|
||||
end)
|
||||
|
||||
it('open warns on unnamed buffer', function()
|
||||
local bufnr = helpers.create_buffer({}, 'typst')
|
||||
it('open warns no output on unnamed buffer', function()
|
||||
local bufnr = helpers.create_buffer({}, 'lua')
|
||||
local msg = capture_notify(function()
|
||||
preview.open(bufnr)
|
||||
end)
|
||||
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)
|
||||
end)
|
||||
end)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue