From 041b2d6f1ea4b683b6ac258abb24ed6bbe72208d Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 4 Feb 2022 21:52:44 +0800 Subject: vim-patch:8.1.2133: some tests fail when run as root Problem: Some tests fail when run as root. Solution: Add CheckNotRoot and use it. (James McCoy, closes vim/vim#5020) https://github.com/vim/vim/commit/07282f01da06c158bab4787adc89ec15d7eeb202 Skip test_terminal.vim and test_viminfo.vim: N/A --- src/nvim/testdir/check.vim | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/nvim/testdir/check.vim') diff --git a/src/nvim/testdir/check.vim b/src/nvim/testdir/check.vim index 76c0f7d422..883f036fe1 100644 --- a/src/nvim/testdir/check.vim +++ b/src/nvim/testdir/check.vim @@ -113,6 +113,14 @@ func CheckNotGui() endif endfunc +" Command to check that test is not running as root +command CheckNotRoot call CheckNotRoot() +func CheckNotRoot() + if IsRoot() + throw 'Skipped: cannot run test as root' + endif +endfunc + " Command to check that the current language is English command CheckEnglish call CheckEnglish() func CheckEnglish() -- cgit