aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ex_cmds/encoding_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-01-02 18:05:52 -0500
committerJustin M. Keyes <justinkz@gmail.com>2016-01-02 18:05:52 -0500
commit59eaba28948137acbd89f31dce1558d97228b9cd (patch)
tree0240a406e072ed50276d6f167ca6659103f20a22 /test/functional/ex_cmds/encoding_spec.lua
parentcb625940422ddfb25fdb9a6dc6c6a26a56a228e8 (diff)
parent70f6e2ce52b966866f57ee5a1753ba420b1bd1a4 (diff)
downloadrneovim-59eaba28948137acbd89f31dce1558d97228b9cd.tar.gz
rneovim-59eaba28948137acbd89f31dce1558d97228b9cd.tar.bz2
rneovim-59eaba28948137acbd89f31dce1558d97228b9cd.zip
Merge pull request #3655 from bfredl/enc_default
Default to encoding=utf-8
Diffstat (limited to 'test/functional/ex_cmds/encoding_spec.lua')
-rw-r--r--test/functional/ex_cmds/encoding_spec.lua25
1 files changed, 13 insertions, 12 deletions
diff --git a/test/functional/ex_cmds/encoding_spec.lua b/test/functional/ex_cmds/encoding_spec.lua
index 997776ca25..6d402b7974 100644
--- a/test/functional/ex_cmds/encoding_spec.lua
+++ b/test/functional/ex_cmds/encoding_spec.lua
@@ -21,20 +21,21 @@ describe('&encoding', function()
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' when enc&vi is 'utf-8', 'utf-8' otherwise
- execute('set fenc=default')
- local enc_default, enc_other, width = eval('&fenc'), 'utf-8', 3
- if enc_default == 'utf-8' then
- enc_other = 'latin1'
- width = 4 -- utf-8 string 'Bär' will count as 4 latin1 chars
- end
+ it('can be changed before startup', function()
+ clear('set enc=latin1')
+ execute('set encoding=utf-8')
+ -- error message expected
+ feed('<cr>')
+ eq('latin1', eval('&encoding'))
+ eq(4, eval('strwidth("Bär")'))
+ end)
- clear('set enc=' .. enc_other)
+ it('is not changed by `set all&`', function()
+ -- we need to set &encoding to something non-default. Use 'latin1'
+ clear('set enc=latin1')
execute('set all&')
- eq(enc_other, eval('&encoding'))
- eq(width, eval('strwidth("Bär")'))
+ eq('latin1', eval('&encoding'))
+ eq(4, eval('strwidth("Bär")'))
end)
end)