From 65fb622000af8e3dbb65480e1581758ecf4ba3e2 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 9 Apr 2017 00:12:26 +0300 Subject: functests: Replace execute with either command or feed_command Hope this will make people using feed_command less likely: this hides bugs. Already found at least two: 1. msgpackparse() will show internal error: hash_add() in case of duplicate keys, though it will still work correctly. Currently silenced. 2. ttimeoutlen was spelled incorrectly, resulting in option not being set when expected. Test was still functioning somehow though. Currently fixed. --- test/functional/legacy/packadd_spec.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'test/functional/legacy/packadd_spec.lua') diff --git a/test/functional/legacy/packadd_spec.lua b/test/functional/legacy/packadd_spec.lua index 2d851819e3..c280888dda 100644 --- a/test/functional/legacy/packadd_spec.lua +++ b/test/functional/legacy/packadd_spec.lua @@ -1,7 +1,7 @@ -- Tests for 'packpath' and :packadd local helpers = require('test.functional.helpers')(after_each) -local clear, source, execute = helpers.clear, helpers.source, helpers.execute +local clear, source, command = helpers.clear, helpers.source, helpers.command local call, eq, nvim = helpers.call, helpers.eq, helpers.meths local feed = helpers.feed @@ -263,12 +263,12 @@ describe('packadd', function() [2] = {bold = true, reverse = true} }) - execute([[let optdir1 = &packpath . '/pack/mine/opt']]) - execute([[let optdir2 = &packpath . '/pack/candidate/opt']]) - execute([[call mkdir(optdir1 . '/pluginA', 'p')]]) - execute([[call mkdir(optdir1 . '/pluginC', 'p')]]) - execute([[call mkdir(optdir2 . '/pluginB', 'p')]]) - execute([[call mkdir(optdir2 . '/pluginC', 'p')]]) + command([[let optdir1 = &packpath . '/pack/mine/opt']]) + command([[let optdir2 = &packpath . '/pack/candidate/opt']]) + command([[call mkdir(optdir1 . '/pluginA', 'p')]]) + command([[call mkdir(optdir1 . '/pluginC', 'p')]]) + command([[call mkdir(optdir2 . '/pluginB', 'p')]]) + command([[call mkdir(optdir2 . '/pluginC', 'p')]]) end) it('works', function() -- cgit From a66eca78c2082aca112125f759be2ef3aa7ef832 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Mon, 21 Aug 2017 12:10:15 -0400 Subject: vim-patch:8.0.0308 Problem: When using a symbolic link, the package path will not be inserted at the right position in 'runtimepath'. (Dugan Chen, Norio Takagi) Solution: Resolve symbolic links when finding the right position in 'runtimepath'. (Hirohito Higashi) https://github.com/vim/vim/commit/2f9e575583c2ad3978ee3d0f790eeff7df56bd6c --- test/functional/legacy/packadd_spec.lua | 38 +++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'test/functional/legacy/packadd_spec.lua') diff --git a/test/functional/legacy/packadd_spec.lua b/test/functional/legacy/packadd_spec.lua index c280888dda..366a154f89 100644 --- a/test/functional/legacy/packadd_spec.lua +++ b/test/functional/legacy/packadd_spec.lua @@ -83,6 +83,39 @@ describe('packadd', function() call assert_equal(new_rtp, &rtp) endfunc + func Test_packadd_symlink_dir() + if !has('unix') + return + endif + let top2_dir = s:topdir . '/Xdir2' + let real_dir = s:topdir . '/Xsym' + silent !ln -s real_dir top2_dir + let &rtp = top2_dir . ',' . top2_dir . '/after' + let &packpath = &rtp + + let s:plugdir = top2_dir . '/pack/mine/opt/mytest' + call mkdir(s:plugdir . '/plugin', 'p') + + exe 'split ' . s:plugdir . '/plugin/test.vim' + call setline(1, 'let g:plugin_works = 44') + wq + let g:plugin_works = 0 + + packadd mytest + + " Must have been inserted in the middle, not at the end + call assert_true(&rtp =~ '/pack/mine/opt/mytest,') + call assert_equal(44, g:plugin_works) + + " No change when doing it again. + let rtp_before = &rtp + packadd mytest + call assert_equal(rtp_before, &rtp) + + set rtp& + let rtp = &rtp + endfunc + func Test_packloadall() " plugin foo with an autoload directory let fooplugindir = &packpath . '/pack/mine/start/foo/plugin' @@ -227,6 +260,11 @@ describe('packadd', function() expected_empty() end) + it('works with symlinks', function() + call('Test_packadd_symlink_dir') + expected_empty() + end) + it('works with :packloadall', function() call('Test_packloadall') expected_empty() -- cgit From 24a556419627d3369f0a55b95dce07cb5316cf8b Mon Sep 17 00:00:00 2001 From: James McCoy Date: Mon, 21 Aug 2017 12:37:24 -0400 Subject: vim-patch:8.0.0325 Problem: Packadd test does not clean up symlink. Solution: Delete the link. (Hirohito Higashi) https://github.com/vim/vim/commit/913727e56761d57aaba61197c2d3485418dea7eb --- test/functional/legacy/packadd_spec.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'test/functional/legacy/packadd_spec.lua') diff --git a/test/functional/legacy/packadd_spec.lua b/test/functional/legacy/packadd_spec.lua index 366a154f89..ba6eba3ce3 100644 --- a/test/functional/legacy/packadd_spec.lua +++ b/test/functional/legacy/packadd_spec.lua @@ -114,6 +114,7 @@ describe('packadd', function() set rtp& let rtp = &rtp + silent !rm top2_dir endfunc func Test_packloadall() -- cgit From 651c6f9b6ebcd76fbf65045ab877fdf38b9d3db2 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Mon, 21 Aug 2017 12:38:24 -0400 Subject: vim-patch:8.0.0326 Problem: Packadd test uses wrong directory name. Solution: Use the variable name value. (Hirohito Higashi) https://github.com/vim/vim/commit/24f8f543d4036c5d2ce4ea6973a174cf2176cb72 --- test/functional/legacy/packadd_spec.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/functional/legacy/packadd_spec.lua') diff --git a/test/functional/legacy/packadd_spec.lua b/test/functional/legacy/packadd_spec.lua index ba6eba3ce3..620f2d7247 100644 --- a/test/functional/legacy/packadd_spec.lua +++ b/test/functional/legacy/packadd_spec.lua @@ -89,7 +89,7 @@ describe('packadd', function() endif let top2_dir = s:topdir . '/Xdir2' let real_dir = s:topdir . '/Xsym' - silent !ln -s real_dir top2_dir + exec "silent! !ln -s" real_dir top2_dir let &rtp = top2_dir . ',' . top2_dir . '/after' let &packpath = &rtp @@ -114,7 +114,7 @@ describe('packadd', function() set rtp& let rtp = &rtp - silent !rm top2_dir + exec "silent !rm" top2_dir endfunc func Test_packloadall() -- cgit From fc7bf1c71d41dae7b8ab7e82b92ec0e8253b5291 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Mon, 21 Aug 2017 12:46:07 -0400 Subject: vim-patch:8.0.0437 Problem: The packadd test does not create the symlink correctly and does not test the right thing. Solution: Create the directory and symlink correctly. https://github.com/vim/vim/commit/644df41c44cbdfacdedbba55ef77a6c6031eccd8 --- test/functional/legacy/packadd_spec.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/functional/legacy/packadd_spec.lua') diff --git a/test/functional/legacy/packadd_spec.lua b/test/functional/legacy/packadd_spec.lua index 620f2d7247..7c44353aec 100644 --- a/test/functional/legacy/packadd_spec.lua +++ b/test/functional/legacy/packadd_spec.lua @@ -89,7 +89,8 @@ describe('packadd', function() endif let top2_dir = s:topdir . '/Xdir2' let real_dir = s:topdir . '/Xsym' - exec "silent! !ln -s" real_dir top2_dir + call mkdir(real_dir, 'p') + exec "silent! !ln -s Xsym" top2_dir let &rtp = top2_dir . ',' . top2_dir . '/after' let &packpath = &rtp -- cgit From 126b2ca077718a02c086039c8f98ef267cf9eb3e Mon Sep 17 00:00:00 2001 From: KillTheMule Date: Sun, 24 Sep 2017 20:42:48 +0200 Subject: test: lint whitespace in legacy/ (#7308) --- test/functional/legacy/packadd_spec.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/functional/legacy/packadd_spec.lua') diff --git a/test/functional/legacy/packadd_spec.lua b/test/functional/legacy/packadd_spec.lua index 7c44353aec..2dfd36142b 100644 --- a/test/functional/legacy/packadd_spec.lua +++ b/test/functional/legacy/packadd_spec.lua @@ -172,9 +172,9 @@ describe('packadd', function() helptags ALL - let tags1 = readfile(docdir1 . '/tags') + let tags1 = readfile(docdir1 . '/tags') call assert_true(tags1[0] =~ 'look-here') - let tags2 = readfile(docdir2 . '/tags') + let tags2 = readfile(docdir2 . '/tags') call assert_true(tags2[0] =~ 'look-away') endfunc -- cgit