From 292eff0c5aacb8531d65509679b6c29eae8dc22a Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 11 Jul 2017 21:46:28 +0200 Subject: patch 8.0.0708: some tests are old style Problem: Some tests are old style. Solution: Change a few tests from old style to new style. (pschuh, closes #1813) --- src/testdir/test_escaped_glob.vim | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/testdir/test_escaped_glob.vim (limited to 'src/testdir/test_escaped_glob.vim') diff --git a/src/testdir/test_escaped_glob.vim b/src/testdir/test_escaped_glob.vim new file mode 100644 index 000000000..6eca8bc71 --- /dev/null +++ b/src/testdir/test_escaped_glob.vim @@ -0,0 +1,25 @@ +" Test whether glob()/globpath() return correct results with certain escaped +" characters. + +function SetUp() + " make sure glob() doesn't use the shell + set shell=doesnotexist + " consistent sorting of file names + set nofileignorecase +endfunction + +function Test_glob() + call assert_equal("", glob('Xxx\{')) + call assert_equal("", glob('Xxx\$')) + w! Xxx{ + w! Xxx\$ + call assert_equal("Xxx{", glob('Xxx\{')) + call assert_equal("Xxx$", glob('Xxx\$')) +endfunction + +function Test_globpath() + call assert_equal("sautest/autoload/Test104.vim\nsautest/autoload/footest.vim", + \ globpath('sautest/autoload', '*.vim')) + call assert_equal(['sautest/autoload/Test104.vim', 'sautest/autoload/footest.vim'], + \ globpath('sautest/autoload', '*.vim', 0, 1)) +endfunction -- cgit v1.2.1