summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_cd.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-03-19 21:37:13 +0100
committerBram Moolenaar <Bram@vim.org>2017-03-19 21:37:13 +0100
commit15618fa643867cf0d9c31f327022a22dff78a0cf (patch)
tree3b2d9c7ea41f496aafba01b1dc9091539e95c282 /src/testdir/test_cd.vim
parent81b9d0bd5c705815e903e671e81b0b05828efd9c (diff)
patch 8.0.0493: crash with cd command with very long argumentv8.0.0493
Problem: Crash with cd command with very long argument. Solution: Check for running out of space. (Dominique pending, closes #1576)
Diffstat (limited to 'src/testdir/test_cd.vim')
-rw-r--r--src/testdir/test_cd.vim13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/testdir/test_cd.vim b/src/testdir/test_cd.vim
new file mode 100644
index 0000000000..e573419bd0
--- /dev/null
+++ b/src/testdir/test_cd.vim
@@ -0,0 +1,13 @@
+" Test for :cd
+
+func Test_cd_large_path()
+ " This used to crash with a heap write overflow.
+ call assert_fails('cd ' . repeat('x', 5000), 'E472:')
+endfunc
+
+func Test_cd_up_and_down()
+ let path = getcwd()
+ cd ..
+ exe 'cd ' . path
+ call assert_equal(path, getcwd())
+endfunc