aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_mksession.vim29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/old/testdir/test_mksession.vim b/test/old/testdir/test_mksession.vim
index 86759f026c..d63d10b44c 100644
--- a/test/old/testdir/test_mksession.vim
+++ b/test/old/testdir/test_mksession.vim
@@ -803,6 +803,35 @@ func Test_mksession_sesdir()
call delete('Xproj', 'rf')
endfunc
+" Test for saving and restoring the tab-local working directory when there is
+" only a single tab and 'tabpages' is not in 'sessionoptions'.
+func Test_mksession_tcd_single_tabs()
+ only | tabonly
+
+ let save_cwd = getcwd()
+ set sessionoptions-=tabpages
+ set sessionoptions+=curdir
+ call mkdir('Xtopdir1')
+ call mkdir('Xtopdir2')
+
+ " There are two tab pages, the current one has local cwd set to 'Xtopdir2'.
+ exec 'tcd ' .. save_cwd .. '/Xtopdir1'
+ tabnew
+ exec 'tcd ' .. save_cwd .. '/Xtopdir2'
+ mksession! Xtest_tcd_single
+
+ source Xtest_tcd_single
+ " call assert_equal(2, haslocaldir())
+ call assert_equal(1, haslocaldir(-1))
+ call assert_equal('Xtopdir2', fnamemodify(getcwd(-1, 0), ':t'))
+ %bwipe
+
+ set sessionoptions&
+ call chdir(save_cwd)
+ call delete('Xtopdir1', 'rf')
+ call delete('Xtopdir2', 'rf')
+endfunc
+
" Test for storing the 'lines' and 'columns' settings
func Test_mksession_resize()
mksession! Xtest_mks1.out