diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-08-22 20:16:16 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-08-22 20:16:16 +0200 |
commit | 3b3a506f57a397d83db361be35189c591bff10fb (patch) | |
tree | a9f213bfe2b54584796a4ac47633d844ed903ab5 /src | |
parent | 320bf2d85e9e2924d896b3072979598c954922e7 (diff) |
patch 8.1.0318: the getftype() test may fail for char devicesv8.1.0318
Problem: The getftype() test may fail for char devices if the file
disappeared in between the listing and the getftype() call.
Solution: Ignore empty result. (Ozaki Kiichi, closes #3360)
Diffstat (limited to 'src')
-rw-r--r-- | src/testdir/test_stat.vim | 18 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 17 insertions, 3 deletions
diff --git a/src/testdir/test_stat.vim b/src/testdir/test_stat.vim index c627266646..33509f0219 100644 --- a/src/testdir/test_stat.vim +++ b/src/testdir/test_stat.vim @@ -141,17 +141,29 @@ func Test_getftype() endif for cdevfile in systemlist('find /dev -type c -maxdepth 2 2>/dev/null') - call assert_equal('cdev', getftype(cdevfile)) + let type = getftype(cdevfile) + " ignore empty result, can happen if the file disappeared + if type != '' + call assert_equal('cdev', type) + endif endfor for bdevfile in systemlist('find /dev -type b -maxdepth 2 2>/dev/null') - call assert_equal('bdev', getftype(bdevfile)) + let type = getftype(bdevfile) + " ignore empty result, can happen if the file disappeared + if type != '' + call assert_equal('bdev', type) + endif endfor " The /run/ directory typically contains socket files. " If it does not, test won't fail but will not test socket files. for socketfile in systemlist('find /run -type s -maxdepth 2 2>/dev/null') - call assert_equal('socket', getftype(socketfile)) + let type = getftype(socketfile) + " ignore empty result, can happen if the file disappeared + if type != '' + call assert_equal('socket', type) + endif endfor " TODO: file type 'other' is not tested. How can we test it? diff --git a/src/version.c b/src/version.c index d5993815c6..1afe230cfb 100644 --- a/src/version.c +++ b/src/version.c @@ -795,6 +795,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 318, +/**/ 317, /**/ 316, |