Mercurial > vim
comparison src/testdir/test_expand_func.vim @ 28635:dfe18756f2ad v8.2.4841
patch 8.2.4841: empty string considered an error for expand()
Commit: https://github.com/vim/vim/commit/a96edb736d4274fc4aea460800780e06e1510812
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Apr 28 17:52:24 2022 +0100
patch 8.2.4841: empty string considered an error for expand()
Problem: Empty string considered an error for expand() when 'verbose' is
set. (Christian Brabandt)
Solution: Do not give an error for an empty result. (closes #10307)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 28 Apr 2022 19:00:05 +0200 |
parents | 195a617b405a |
children | 5cf6dee0f305 |
comparison
equal
deleted
inserted
replaced
28634:141b43248424 | 28635:dfe18756f2ad |
---|---|
80 delcommand Slnum | 80 delcommand Slnum |
81 endfunc | 81 endfunc |
82 | 82 |
83 func Test_expand() | 83 func Test_expand() |
84 new | 84 new |
85 call assert_equal("", expand('%:S')) | 85 call assert_equal("''", expand('%:S')) |
86 call assert_equal('3', '<slnum>'->expand()) | 86 call assert_equal('3', '<slnum>'->expand()) |
87 call assert_equal(['4'], expand('<slnum>', v:false, v:true)) | 87 call assert_equal(['4'], expand('<slnum>', v:false, v:true)) |
88 " Don't add any line above this, otherwise <slnum> will change. | 88 " Don't add any line above this, otherwise <slnum> will change. |
89 call assert_equal("", expand('%')) | |
90 set verbose=1 | |
91 call assert_equal("", expand('%')) | |
92 set verbose=0 | |
89 quit | 93 quit |
90 endfunc | 94 endfunc |
91 | 95 |
92 func s:sid_test() | 96 func s:sid_test() |
93 return 'works' | 97 return 'works' |