summaryrefslogtreecommitdiff
path: root/src/testdir/test_shortpathname.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-10-30 04:10:06 +0100
committerBram Moolenaar <Bram@vim.org>2019-10-30 04:10:06 +0100
commit3f39697b73f661d6900c7cf5430d967a129660d7 (patch)
tree2da749fd7cde4051bc15f9b35646d6526a0a2cdc /src/testdir/test_shortpathname.vim
parent69bf634858a2a75f2984e42b1e4017bc529a040a (diff)
downloadvim-git-3f39697b73f661d6900c7cf5430d967a129660d7.tar.gz
patch 8.1.2234: get_short_pathname() fails depending on encodingv8.1.2234
Problem: get_short_pathname() fails depending on encoding. Solution: Use the wide version of the library function. (closes #5129)
Diffstat (limited to 'src/testdir/test_shortpathname.vim')
-rw-r--r--src/testdir/test_shortpathname.vim20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/testdir/test_shortpathname.vim b/src/testdir/test_shortpathname.vim
index b88482016..6b3f85f18 100644
--- a/src/testdir/test_shortpathname.vim
+++ b/src/testdir/test_shortpathname.vim
@@ -1,6 +1,9 @@
" Test for shortpathname ':8' extension.
" Only for use on Win32 systems!
+set encoding=utf-8
+scriptencoding utf-8
+
source check.vim
CheckMSWindows
@@ -67,3 +70,20 @@ func Test_ColonEight()
exe "cd " . save_dir
endfunc
+
+func Test_ColonEight_MultiByte()
+ let dir = 'Xtest'
+
+ let file = dir . '/日本語のファイル.txt'
+
+ call mkdir(dir)
+ call writefile([], file)
+
+ let sfile = fnamemodify(file, ':8')
+
+ call assert_notequal(file, sfile)
+ call assert_match('\~', sfile)
+
+ call delete(file)
+ call delete(dir, 'd')
+endfunc