Mercurial > vim
view src/testdir/test_scriptnames.vim @ 23432:a8602bad9e9a v8.2.2259
patch 8.2.2259: Test_Executable() fails when using chroot
Commit: https://github.com/vim/vim/commit/a387083b2f65c2c14b19087c7d7f94ca23de1d48
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jan 1 14:20:44 2021 +0100
patch 8.2.2259: Test_Executable() fails when using chroot
Problem: Test_Executable() fails when using chroot.
Solution: Ignore the difference between "sbin" and "bin".
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 01 Jan 2021 14:30:03 +0100 |
parents | 08940efa6b4e |
children | fa09602eae48 |
line wrap: on
line source
" Test for :scriptnames func Test_scriptnames() call writefile(['let did_load_script = 123'], 'Xscripting') source Xscripting call assert_equal(123, g:did_load_script) let scripts = split(execute('scriptnames'), "\n") let last = scripts[-1] call assert_match('\<Xscripting\>', last) let lastnr = substitute(last, '\D*\(\d\+\):.*', '\1', '') exe 'script ' . lastnr call assert_equal('Xscripting', expand('%:t')) call assert_fails('script ' . (lastnr + 1), 'E474:') call assert_fails('script 0', 'E939:') new call setline(1, 'nothing') call assert_fails('script ' . lastnr, 'E37:') exe 'script! ' . lastnr call assert_equal('Xscripting', expand('%:t')) bwipe call delete('Xscripting') endfunc " vim: shiftwidth=2 sts=2 expandtab