Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame^] | 1 | Tests for 'directory' option. |
| 2 | - ".", in same dir as file |
| 3 | - "./dir", in directory relative to file |
| 4 | - "dir", in directory relative to current dir |
| 5 | |
| 6 | STARTTEST |
| 7 | :so small.vim |
| 8 | :set nocompatible viminfo+=nviminfo |
| 9 | :set dir=.,~ |
| 10 | :/start of testfile/,/end of testfile/w! Xtest1 |
| 11 | :" do an ls of the current dir to find the swap file (should not be there) |
| 12 | :if has("unix") |
| 13 | : !ls .X*.swp >test.out |
| 14 | :else |
| 15 | : r !ls X*.swp >test.out |
| 16 | :endif |
| 17 | :!echo first line >>test.out |
| 18 | :e Xtest1 |
| 19 | :if has("unix") |
| 20 | :" Do an ls of the current dir to find the swap file, remove the leading dot |
| 21 | :" to make the result the same for all systems. |
| 22 | : r!ls .X*.swp |
| 23 | : s/\.*X/X/ |
| 24 | : .w >>test.out |
| 25 | : undo |
| 26 | :else |
| 27 | : !ls X*.swp >>test.out |
| 28 | :endif |
| 29 | :!echo under Xtest1.swp >>test.out |
| 30 | :!mkdir Xtest2 |
| 31 | :set dir=./Xtest2,.,~ |
| 32 | :e Xtest1 |
| 33 | :!ls X*.swp >>test.out |
| 34 | :!echo under under >>test.out |
| 35 | :!ls Xtest2 >>test.out |
| 36 | :!echo under Xtest1.swp >>test.out |
| 37 | :!mkdir Xtest.je |
| 38 | :/start of testfile/,/end of testfile/w! Xtest2/Xtest3 |
| 39 | :set dir=Xtest.je,~ |
| 40 | :e Xtest2/Xtest3 |
| 41 | :swap |
| 42 | :!ls Xtest2 >>test.out |
| 43 | :!echo under Xtest3 >>test.out |
| 44 | :!ls Xtest.je >>test.out |
| 45 | :!echo under Xtest3.swp >>test.out |
| 46 | :qa! |
| 47 | ENDTEST |
| 48 | |
| 49 | start of testfile |
| 50 | line 2 Abcdefghij |
| 51 | line 3 Abcdefghij |
| 52 | end of testfile |