annotate src/testdir/test50.in @ 6795:adb3699fa30c v7.4.719

patch 7.4.719 Problem: Overflow when adding MAXCOL to a pointer. Solution: Subtract pointers instead. (James McCoy)
author Bram Moolenaar <bram@vim.org>
date Mon, 04 May 2015 16:10:26 +0200
parents 5cd32322154c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 Test for shortpathname ':8' extension.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 Only for use on Win32 systems!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 STARTTEST
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 :so small.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 :fun! TestIt(file, bits, expected)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 let res=fnamemodify(a:file,a:bits)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 if a:expected == ''
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 echo "'".a:file."'->(".a:bits.")->'".res."'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 if substitute(res,'/','\\', 'g') != substitute( a:expected, '/','\\', 'g')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 echo "FAILED: '".a:file."'->(".a:bits.")->'".res."'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 echo "Expected: '".a:expected."'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 echo "OK"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 endfun
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 :fun! MakeDir( dirname )
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 "exe '!mkdir '.substitute(a:dirname,'/','\\','g')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 call system('mkdir '.substitute(a:dirname,'/','\\','g'))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 endfun
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 :fun! RMDir( dirname)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 "exe '!rmdir '.substitute(a:dirname,'/','\\','g')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 call system('rmdir '.substitute(a:dirname,'/','\\','g'))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 endfun
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 :fun! MakeFile( filename)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 "exe '!copy nul '.substitute(a:filename,'/','\\','g')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 call system('copy nul '.substitute(a:filename,'/','\\','g'))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 endfun
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 :fun! TestColonEight()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 redir! >test.out
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 " This could change for CygWin to //cygdrive/c
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 let dir1='c:/x.x.y'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 if filereadable(dir1) || isdirectory(dir1)
4956
5cd32322154c updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
36 echo "FATAL: '".dir1."' exists, cannot run test"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 return
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 let file1=dir1.'/zz.y.txt'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 let nofile1=dir1.'/z.y.txt'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 let dir2=dir1.'/VimIsTheGreatestSinceSlicedBread'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 let file2=dir2.'/z.txt'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 let nofile2=dir2.'/zz.txt'
4956
5cd32322154c updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
44 call MakeDir( dir1 )
5cd32322154c updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
45 let resdir1 = substitute(fnamemodify(dir1, ':p:8'), '\\$', '', '')
5cd32322154c updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
46 if resdir1 !~ '\V\^c:/XX\x\x\x\x~1.Y\$'
5cd32322154c updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
47 echo "FATAL: unexpected short name: " . resdir1
5cd32322154c updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
48 echo "INFO: please report your OS to vim-dev"
5cd32322154c updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
49 return
5cd32322154c updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
50 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 let resfile1=resdir1.'/ZZY~1.TXT'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 let resnofile1=resdir1.'/z.y.txt'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 let resdir2=resdir1.'/VIMIST~1'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 let resfile2=resdir2.'/z.txt'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 let resnofile2=resdir2.'/zz.txt'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 call MakeDir( dir2 )
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 call MakeFile( file1 )
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 call MakeFile( file2 )
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 call TestIt(file1, ':p:8', resfile1)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 call TestIt(nofile1, ':p:8', resnofile1)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 call TestIt(file2, ':p:8', resfile2)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 call TestIt(nofile2, ':p:8', resnofile2)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 call TestIt(nofile2, ':p:8:h', fnamemodify(resnofile2,':h'))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 exe 'cd '.dir1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 call TestIt(file1, ':.:8', strpart(resfile1,strlen(resdir1)+1))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 call TestIt(nofile1, ':.:8', strpart(resnofile1,strlen(resdir1)+1))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 call TestIt(file2, ':.:8', strpart(resfile2,strlen(resdir1)+1))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 call TestIt(nofile2, ':.:8', strpart(resnofile2,strlen(resdir1)+1))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 let $HOME=dir1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 call TestIt(file1, ':~:8', '~'.strpart(resfile1,strlen(resdir1)))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 call TestIt(nofile1, ':~:8', '~'.strpart(resnofile1,strlen(resdir1)))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 call TestIt(file2, ':~:8', '~'.strpart(resfile2,strlen(resdir1)))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 call TestIt(nofile2, ':~:8', '~'.strpart(resnofile2,strlen(resdir1)))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 cd c:/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 call delete( file2 )
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 call delete( file1 )
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 call RMDir( dir2 )
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 call RMDir( dir1 )
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 echo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 redir END
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 endfun
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 :let dir = getcwd()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 :call TestColonEight()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 :exe "cd " . dir
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 :edit! test.out
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 :set ff=dos
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 :w
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 :qa!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 ENDTEST
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90