From 20f44f44a25e41c356fceb1df74e9c6a5149c8fa Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Fri, 13 Mar 2026 08:20:48 -0400 Subject: [PATCH] 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"). --- spec/init_spec.lua | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/spec/init_spec.lua b/spec/init_spec.lua index f68438c..55c2391 100644 --- a/spec/init_spec.lua +++ b/spec/init_spec.lua @@ -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)