Merge pull request #25812 from famiu/test/api/option_value/modified

test: add test coverage for #25741
This commit is contained in:
bfredl 2023-10-28 21:47:40 +02:00 committed by GitHub
commit c5f2472661
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1477,14 +1477,6 @@ describe('API', function()
nvim('set_option_value', 'debug', 'beep', {}) nvim('set_option_value', 'debug', 'beep', {})
eq(true, nvim('get_option_info2', 'debug', {}).was_set) eq(true, nvim('get_option_info2', 'debug', {}).was_set)
end) end)
end)
describe('nvim_get_option_value, nvim_set_option_value', function()
it('works', function()
ok(nvim('get_option_value', 'equalalways', {}))
nvim('set_option_value', 'equalalways', false, {})
ok(not nvim('get_option_value', 'equalalways', {}))
end)
it('validation', function() it('validation', function()
eq("Invalid 'scope': expected 'local' or 'global'", eq("Invalid 'scope': expected 'local' or 'global'",
@ -1616,6 +1608,15 @@ describe('API', function()
pcall_err(nvim, 'get_option_value', 'commentstring', { filetype = 'lua' })) pcall_err(nvim, 'get_option_value', 'commentstring', { filetype = 'lua' }))
end) end)
it("value of 'modified' is always false for scratch buffers", function()
nvim('set_current_buf', nvim('create_buf', true, true))
insert([[
foo
bar
baz
]])
eq(false, nvim('get_option_value', 'modified', {}))
end)
end) end)
describe('nvim_{get,set}_current_buf, nvim_list_bufs', function() describe('nvim_{get,set}_current_buf, nvim_list_bufs', function()