aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ex_cmds/encoding_spec.lua
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2016-11-05 18:12:14 +0100
committerGitHub <noreply@github.com>2016-11-05 18:12:14 +0100
commit9147331e212e8d0fff0f30344007faffd42609ee (patch)
tree6d1853a72b94ce19ba0cc163c664a9a206da0091 /test/functional/ex_cmds/encoding_spec.lua
parent32d9c19e294f38a6adae6e055fc606fc3fd33f2f (diff)
parent4ab3fe8eaadb5456eeafc49df2fb0ecf71d836cc (diff)
downloadrneovim-9147331e212e8d0fff0f30344007faffd42609ee.tar.gz
rneovim-9147331e212e8d0fff0f30344007faffd42609ee.tar.bz2
rneovim-9147331e212e8d0fff0f30344007faffd42609ee.zip
Merge pull request #2905 from bfredl/utf8
Only allow encoding=utf-8 and simplify multibyte code
Diffstat (limited to 'test/functional/ex_cmds/encoding_spec.lua')
-rw-r--r--test/functional/ex_cmds/encoding_spec.lua23
1 files changed, 11 insertions, 12 deletions
diff --git a/test/functional/ex_cmds/encoding_spec.lua b/test/functional/ex_cmds/encoding_spec.lua
index e2b3e7e31d..87ed7a2d0a 100644
--- a/test/functional/ex_cmds/encoding_spec.lua
+++ b/test/functional/ex_cmds/encoding_spec.lua
@@ -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)