Mercurial > vim
comparison src/testdir/test_functions.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 | 2351b40af967 |
children | a45a922832d4 |
comparison
equal
deleted
inserted
replaced
23431:0bd872d3d9fc | 23432:a8602bad9e9a |
---|---|
1286 let catcmd = exepath('cat')[1:] | 1286 let catcmd = exepath('cat')[1:] |
1287 new | 1287 new |
1288 " check that the relative path works in / | 1288 " check that the relative path works in / |
1289 lcd / | 1289 lcd / |
1290 call assert_equal(1, executable(catcmd)) | 1290 call assert_equal(1, executable(catcmd)) |
1291 call assert_equal('/' .. catcmd, catcmd->exepath()) | 1291 let result = catcmd->exepath() |
1292 " when using chroot looking for sbin/cat can return bin/cat, that is OK | |
1293 if catcmd =~ '\<sbin\>' && result =~ '\<bin\>' | |
1294 call assert_equal('/' .. substitute(catcmd, '\<sbin\>', 'bin', ''), result) | |
1295 else | |
1296 call assert_equal('/' .. catcmd, result) | |
1297 endif | |
1292 bwipe | 1298 bwipe |
1293 else | 1299 else |
1294 throw 'Skipped: does not work on this platform' | 1300 throw 'Skipped: does not work on this platform' |
1295 endif | 1301 endif |
1296 endfunc | 1302 endfunc |