patch 8.0.0405: v:progpath may become invalid after :cd
Problem: v:progpath may become invalid after ":cd".
Solution: Turn v:progpath into a full path if needed.
diff --git a/src/testdir/test_startup.vim b/src/testdir/test_startup.vim
index 8e3238c..9d59138 100644
--- a/src/testdir/test_startup.vim
+++ b/src/testdir/test_startup.vim
@@ -183,3 +183,17 @@
endif
call delete('Xtestout')
endfunc
+
+func Test_progpath()
+ " Tests normally run with "./vim" or "../vim", these must have been expanded
+ " to a full path.
+ if has('unix')
+ call assert_equal('/', v:progpath[0])
+ elseif has('win32')
+ call assert_equal(':', v:progpath[1])
+ call assert_match('[/\\]', v:progpath[2])
+ endif
+
+ " Only expect "vim" to appear in v:progname.
+ call assert_match('vim\c', v:progname)
+endfunc