]> granicus.if.org Git - vim/commitdiff
patch 8.1.0817: ":=" command is not tested v8.1.0817
authorBram Moolenaar <Bram@vim.org>
Thu, 24 Jan 2019 21:42:37 +0000 (22:42 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 24 Jan 2019 21:42:37 +0000 (22:42 +0100)
Problem:    ":=" command is not tested.
Solution:   Add a test. (Dominique Pelle, closes #3859)

src/testdir/Make_all.mak
src/testdir/test_alot.vim
src/testdir/test_ex_equal.vim [new file with mode: 0644]
src/version.c

index 39b6889112738482207f2e6647a34350a476a5d8..5857a228f53a1d836dbfa7ec72adf7e5369370ca 100644 (file)
@@ -105,6 +105,7 @@ NEW_TESTS = \
        test_erasebackword \
        test_escaped_glob \
        test_eval_stuff \
+       test_ex_equal \
        test_ex_undo \
        test_ex_z \
        test_exit \
index be665120b356fb92cbfa9ec3ff1711a65dd7fd73..81873af2e687e4b10dd42107173b52f3157aa789 100644 (file)
@@ -10,6 +10,7 @@ source test_changedtick.vim
 source test_compiler.vim
 source test_cursor_func.vim
 source test_delete.vim
+source test_ex_equal.vim
 source test_ex_undo.vim
 source test_ex_z.vim
 source test_execute_func.vim
diff --git a/src/testdir/test_ex_equal.vim b/src/testdir/test_ex_equal.vim
new file mode 100644 (file)
index 0000000..05ad276
--- /dev/null
@@ -0,0 +1,32 @@
+" Test Ex := command.
+
+func Test_ex_equal()
+  new
+  call setline(1, ["foo\tbar", "bar\tfoo"])
+
+  let a = execute('=')
+  call assert_equal("\n2", a)
+
+  let a = execute('=#')
+  call assert_equal("\n2\n  1 foo     bar", a)
+
+  let a = execute('=l')
+  call assert_equal("\n2\nfoo^Ibar$", a)
+
+  let a = execute('=p')
+  call assert_equal("\n2\nfoo     bar", a)
+
+  let a = execute('=l#')
+  call assert_equal("\n2\n  1 foo^Ibar$", a)
+
+  let a = execute('=p#')
+  call assert_equal("\n2\n  1 foo     bar", a)
+
+  let a = execute('.=')
+  call assert_equal("\n1", a)
+
+  call assert_fails('3=', 'E16:')
+  call assert_fails('=x', 'E488:')
+
+  bwipe!
+endfunc
index 1cd591ffb238d07c36be97c4f1da68677b75bd8d..532b449ddc059c002fa650520b4db35bc04a348a 100644 (file)
@@ -787,6 +787,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    817,
 /**/
     816,
 /**/