mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
encoding: update tests
Change shada reencoding tests to check for correct handling of UTF-8 and binary strings. Delete enc=latin1 json tests.
This commit is contained in:
@@ -15,27 +15,26 @@ describe('&encoding', function()
|
||||
execute('set encoding=latin1')
|
||||
-- error message expected
|
||||
feed('<cr>')
|
||||
neq(nil, string.find(eval('v:errmsg'), '^E905:'))
|
||||
neq(nil, string.find(eval('v:errmsg'), '^E474:'))
|
||||
eq('utf-8', eval('&encoding'))
|
||||
-- check nvim is still in utf-8 mode
|
||||
eq(3, eval('strwidth("Bär")'))
|
||||
end)
|
||||
|
||||
it('can be changed before startup', function()
|
||||
it('cannot be changed before startup', function()
|
||||
clear('--cmd', 'set enc=latin1')
|
||||
execute('set encoding=utf-8')
|
||||
-- error message expected
|
||||
feed('<cr>')
|
||||
eq('latin1', eval('&encoding'))
|
||||
eq(4, eval('strwidth("Bär")'))
|
||||
neq(nil, string.find(eval('v:errmsg'), '^E474:'))
|
||||
eq('utf-8', eval('&encoding'))
|
||||
eq(3, eval('strwidth("Bär")'))
|
||||
end)
|
||||
|
||||
it('is not changed by `set all&`', function()
|
||||
-- we need to set &encoding to something non-default. Use 'latin1'
|
||||
clear('--cmd', 'set enc=latin1')
|
||||
execute('set all&')
|
||||
eq('latin1', eval('&encoding'))
|
||||
eq(4, eval('strwidth("Bär")'))
|
||||
end)
|
||||
it('can be set to utf-8 without error', function()
|
||||
execute('set encoding=utf-8')
|
||||
eq("", eval('v:errmsg'))
|
||||
|
||||
clear('--cmd', 'set enc=utf-8')
|
||||
eq("", eval('v:errmsg'))
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user