diff src/testdir/test_partial.vim @ 8637:ff41ece2e4b8 v7.4.1608

commit https://github.com/vim/vim/commit/5c29154b521e9948190be653cfda666ecbb63b5b Author: Bram Moolenaar <Bram@vim.org> Date: Sat Mar 19 20:05:45 2016 +0100 patch 7.4.1608 Problem: string() doesn't handle a partial. Solution: Make a string from a partial.
author Christian Brabandt <cb@256bit.org>
date Sat, 19 Mar 2016 20:15:05 +0100
parents ddb04cbe1e0c
children 13b0ed12a78a
line wrap: on
line diff
--- a/src/testdir/test_partial.vim
+++ b/src/testdir/test_partial.vim
@@ -156,3 +156,17 @@ func Test_partial_exists()
   let lF = [F]
   call assert_true(exists('*lF[0]'))
 endfunc
+
+func Test_partial_string()
+  let F = function('MyFunc')
+  call assert_equal("function('MyFunc')", string(F))
+  let F = function('MyFunc', ['foo'])
+  call assert_equal("function('MyFunc', ['foo'])", string(F))
+  let F = function('MyFunc', ['foo', 'bar'])
+  call assert_equal("function('MyFunc', ['foo', 'bar'])", string(F))
+  let d = {'one': 1}
+  let F = function('MyFunc', d)
+  call assert_equal("function('MyFunc', {'one': 1})", string(F))
+  let F = function('MyFunc', ['foo'], d)
+  call assert_equal("function('MyFunc', ['foo'], {'one': 1})", string(F))
+endfunc