1
0
forked from aniani/vim

patch 7.4.1157

Problem:    type() does not work for v:true, v:none, etc.
Solution:   Add new type numbers.
This commit is contained in:
Bram Moolenaar
2016-01-23 21:59:52 +01:00
parent 2dedb45260
commit f95534c3d4
4 changed files with 40 additions and 0 deletions

View File

@@ -88,4 +88,18 @@ func Test_decode()
call assert_equal(s:vard2x, jsondecode(s:jsond2))
call assert_equal(s:varvals, jsondecode(s:jsonvals))
call assert_equal(v:true, jsondecode('true'))
call assert_equal(type(v:true), type(jsondecode('true')))
call assert_equal(v:none, jsondecode(''))
call assert_equal(type(v:none), type(jsondecode('')))
call assert_equal("", jsondecode('""'))
call assert_fails('call jsondecode("\"")', "E474:")
call assert_fails('call jsondecode("{-}")', "E474:")
call assert_fails('call jsondecode("blah")', "E474:")
call assert_fails('call jsondecode("true blah")', "E474:")
call assert_fails('call jsondecode("<foobar>")', "E474:")
call assert_fails('call jsondecode("[foobar]")', "E474:")
call assert_fails('call jsondecode("{foobar}")', "E474:")
endfunc