Mercurial > vim
comparison src/testdir/test_viml.vim @ 7718:6ebd8bdf41bc v7.4.1157
commit https://github.com/vim/vim/commit/f95534c3d411084d1b6112fe64f6108bf7acbb92
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 23 21:59:52 2016 +0100
patch 7.4.1157
Problem: type() does not work for v:true, v:none, etc.
Solution: Add new type numbers.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 23 Jan 2016 22:00:05 +0100 |
parents | d9ec7d22494d |
children | 80ce794827c4 |
comparison
equal
deleted
inserted
replaced
7717:9ad4ca70bcea | 7718:6ebd8bdf41bc |
---|---|
920 let g:a[g:b] = 77 | 920 let g:a[g:b] = 77 |
921 call assert_equal(77, g:a['t']) | 921 call assert_equal(77, g:a['t']) |
922 endfunc | 922 endfunc |
923 | 923 |
924 "------------------------------------------------------------------------------- | 924 "------------------------------------------------------------------------------- |
925 " Test 91: using type(). {{{1 | |
926 "------------------------------------------------------------------------------- | |
927 | |
928 func Test_type() | |
929 call assert_equal(0, type(0)) | |
930 call assert_equal(1, type("")) | |
931 call assert_equal(2, type(function("tr"))) | |
932 call assert_equal(3, type([])) | |
933 call assert_equal(4, type({})) | |
934 call assert_equal(5, type(0.0)) | |
935 call assert_equal(6, type(v:false)) | |
936 call assert_equal(6, type(v:true)) | |
937 call assert_equal(7, type(v:none)) | |
938 call assert_equal(7, type(v:null)) | |
939 endfunc | |
940 | |
941 "------------------------------------------------------------------------------- | |
925 " Modelines {{{1 | 942 " Modelines {{{1 |
926 " vim: ts=8 sw=4 tw=80 fdm=marker | 943 " vim: ts=8 sw=4 tw=80 fdm=marker |
927 " vim: fdt=substitute(substitute(foldtext(),\ '\\%(^+--\\)\\@<=\\(\\s*\\)\\(.\\{-}\\)\:\ \\%(\"\ \\)\\=\\(Test\ \\d*\\)\:\\s*',\ '\\3\ (\\2)\:\ \\1',\ \"\"),\ '\\(Test\\s*\\)\\(\\d\\)\\D\\@=',\ '\\1\ \\2',\ "") | 944 " vim: fdt=substitute(substitute(foldtext(),\ '\\%(^+--\\)\\@<=\\(\\s*\\)\\(.\\{-}\\)\:\ \\%(\"\ \\)\\=\\(Test\ \\d*\\)\:\\s*',\ '\\3\ (\\2)\:\ \\1',\ \"\"),\ '\\(Test\\s*\\)\\(\\d\\)\\D\\@=',\ '\\1\ \\2',\ "") |
928 "------------------------------------------------------------------------------- | 945 "------------------------------------------------------------------------------- |