diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-01-12 21:49:00 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-01-12 21:49:00 +0100 |
commit | a47e05f04a5a5c0369c949157c24d09cbe64ad6a (patch) | |
tree | 7d6a27b717ed6c478f4642fd7af13913a4c07f3b /src/testdir/test_vimscript.vim | |
parent | 64ed4d4398e92ac56a9bbd66d5ec992dd4c335f7 (diff) | |
download | vim-git-a47e05f04a5a5c0369c949157c24d09cbe64ad6a.tar.gz |
patch 8.2.2339: cannot get the type of a value as a stringv8.2.2339
Problem: Cannot get the type of a value as a string.
Solution: Add typename().
Diffstat (limited to 'src/testdir/test_vimscript.vim')
-rw-r--r-- | src/testdir/test_vimscript.vim | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/testdir/test_vimscript.vim b/src/testdir/test_vimscript.vim index dba8c73fc..0ba933b7c 100644 --- a/src/testdir/test_vimscript.vim +++ b/src/testdir/test_vimscript.vim @@ -6600,6 +6600,14 @@ func Test_type() call ChangeYourMind() endfunc +func Test_typename() + call assert_equal('number', typename(123)) + call assert_equal('string', typename('x')) + call assert_equal('list<number>', typename([123])) + call assert_equal('dict<number>', typename(#{key: 123})) + call assert_equal('list<dict<number>>', typename([#{key: 123}])) +endfunc + "------------------------------------------------------------------------------- " Test 92: skipping code {{{1 "------------------------------------------------------------------------------- |