Mercurial > vim
comparison src/testdir/test_expand_func.vim @ 30405:ea38db8639eb v9.0.0538
patch 9.0.0538: manually deleting test temp files
Commit: https://github.com/vim/vim/commit/5c645a25bb8e6d766db720a44b9ceeff39d1e92b
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Sep 21 22:00:03 2022 +0100
patch 9.0.0538: manually deleting test temp files
Problem: Manually deleting test temp files.
Solution: Add the 'D' flag to writefile().
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 21 Sep 2022 23:15:03 +0200 |
parents | 32f358d71ec2 |
children | dbec60b8c253 |
comparison
equal
deleted
inserted
replaced
30404:20bbd0c0761b | 30405:ea38db8639eb |
---|---|
54 " Use <stack> from sourced script. | 54 " Use <stack> from sourced script. |
55 let lines =<< trim END | 55 let lines =<< trim END |
56 " comment here | 56 " comment here |
57 let g:stack_value = expand('<stack>') | 57 let g:stack_value = expand('<stack>') |
58 END | 58 END |
59 call writefile(lines, 'Xstack') | 59 call writefile(lines, 'Xstack', 'D') |
60 source Xstack | 60 source Xstack |
61 call assert_match('\<Xstack\[2\]$', g:stack_value) | 61 call assert_match('\<Xstack\[2\]$', g:stack_value) |
62 unlet g:stack_value | 62 unlet g:stack_value |
63 call delete('Xstack') | |
64 | 63 |
65 if exists('+shellslash') | 64 if exists('+shellslash') |
66 call mkdir('Xshellslash') | 65 call mkdir('Xshellslash', 'R') |
67 let lines =<< trim END | 66 let lines =<< trim END |
68 let g:stack1 = expand('<stack>') | 67 let g:stack1 = expand('<stack>') |
69 set noshellslash | 68 set noshellslash |
70 let g:stack2 = expand('<stack>') | 69 let g:stack2 = expand('<stack>') |
71 set shellslash | 70 set shellslash |
81 call assert_match('\<Xshellslash/Xstack\[5\]$', g:stack3) | 80 call assert_match('\<Xshellslash/Xstack\[5\]$', g:stack3) |
82 unlet g:stack1 | 81 unlet g:stack1 |
83 unlet g:stack2 | 82 unlet g:stack2 |
84 unlet g:stack3 | 83 unlet g:stack3 |
85 endfor | 84 endfor |
86 call delete('Xshellslash', 'rf') | |
87 endif | 85 endif |
88 endfunc | 86 endfunc |
89 | 87 |
90 func Test_expand_slnum() | 88 func Test_expand_slnum() |
91 call assert_equal(6, s:slnum) | 89 call assert_equal(6, s:slnum) |