comparison src/testdir/test_functions.vim @ 16752:e2d8d83e6721 v8.1.1378

patch 8.1.1378: delete() can not handle a file name that looks like a pattern commit https://github.com/vim/vim/commit/701ff0a3e53d253d7300c385e582659bbff7860d Author: Bram Moolenaar <Bram@vim.org> Date: Fri May 24 14:14:14 2019 +0200 patch 8.1.1378: delete() can not handle a file name that looks like a pattern Problem: Delete() can not handle a file name that looks like a pattern. Solution: Use readdir() instead of appending "/*" and expanding wildcards. (Ken Takata, closes #4424, closes #696)
author Bram Moolenaar <Bram@vim.org>
date Fri, 24 May 2019 14:15:04 +0200
parents 81be817c9d9a
children f42aa3d90b12
comparison
equal deleted inserted replaced
16751:29ae90e9f16a 16752:e2d8d83e6721
1434 call assert_equal(1, len(files)) 1434 call assert_equal(1, len(files))
1435 1435
1436 call delete('Xdir', 'rf') 1436 call delete('Xdir', 'rf')
1437 endfunc 1437 endfunc
1438 1438
1439 func Test_delete_rf()
1440 call mkdir('Xdir')
1441 call writefile([], 'Xdir/foo.txt')
1442 call writefile([], 'Xdir/bar.txt')
1443 call mkdir('Xdir/[a-1]') " issue #696
1444 call writefile([], 'Xdir/[a-1]/foo.txt')
1445 call writefile([], 'Xdir/[a-1]/bar.txt')
1446 call assert_true(filereadable('Xdir/foo.txt'))
1447 call assert_true(filereadable('Xdir/[a-1]/foo.txt'))
1448
1449 call assert_equal(0, delete('Xdir', 'rf'))
1450 call assert_false(filereadable('Xdir/foo.txt'))
1451 call assert_false(filereadable('Xdir/[a-1]/foo.txt'))
1452 endfunc
1453
1439 func Test_call() 1454 func Test_call()
1440 call assert_equal(3, call('len', [123])) 1455 call assert_equal(3, call('len', [123]))
1441 call assert_fails("call call('len', 123)", 'E714:') 1456 call assert_fails("call call('len', 123)", 'E714:')
1442 call assert_equal(0, call('', [])) 1457 call assert_equal(0, call('', []))
1443 1458