1
0
forked from aniani/vim

patch 8.2.1183: assert_fails() checks the last error message

Problem:    assert_fails() checks the last error message.
Solution:   Check the first error, it is more relevant.  Fix all the tests
            that rely on the old behavior.
This commit is contained in:
Bram Moolenaar
2020-07-11 22:14:59 +02:00
parent 914e7eaa67
commit 9b7bf9e98f
53 changed files with 225 additions and 152 deletions

View File

@@ -181,7 +181,7 @@ func Test_json_decode()
call assert_fails('call json_decode("{\"n\",1}")', "E491:")
call assert_fails('call json_decode("{-}")', "E491:")
if has('float')
call assert_fails('call json_decode("{3.14:1}")', "E474:")
call assert_fails('call json_decode("{3.14:1}")', "E806:")
endif
call assert_fails('call json_decode("[foobar]")', "E491:")
@@ -292,25 +292,25 @@ func Test_js_decode()
call assert_equal({'n': 1}, js_decode('{"n":1,}'))
call assert_equal({'n': '1'}, js_decode("{'n':'1',}"))
call assert_fails('call js_decode("\"")', "E474:")
call assert_fails('call js_decode("blah")', "E474:")
call assert_fails('call js_decode("true blah")', "E474:")
call assert_fails('call js_decode("<foobar>")', "E474:")
call assert_fails('call js_decode("\"")', "E491:")
call assert_fails('call js_decode("blah")', "E491:")
call assert_fails('call js_decode("true blah")', "E488:")
call assert_fails('call js_decode("<foobar>")', "E491:")
call assert_fails('call js_decode("{")', "E474:")
call assert_fails('call js_decode("{foobar}")', "E474:")
call assert_fails('call js_decode("{\"n\",")', "E474:")
call assert_fails('call js_decode("{\"n\":")', "E474:")
call assert_fails('call js_decode("{\"n\":1")', "E474:")
call assert_fails('call js_decode("{\"n\":1,")', "E474:")
call assert_fails('call js_decode("{\"n\",1}")', "E474:")
call assert_fails('call js_decode("{-}")', "E474:")
call assert_fails('call js_decode("{")', "E491:")
call assert_fails('call js_decode("{foobar}")', "E491:")
call assert_fails('call js_decode("{\"n\",")', "E491:")
call assert_fails('call js_decode("{\"n\":")', "E491:")
call assert_fails('call js_decode("{\"n\":1")', "E491:")
call assert_fails('call js_decode("{\"n\":1,")', "E491:")
call assert_fails('call js_decode("{\"n\",1}")', "E491:")
call assert_fails('call js_decode("{-}")', "E491:")
call assert_fails('call js_decode("[foobar]")', "E474:")
call assert_fails('call js_decode("[")', "E474:")
call assert_fails('call js_decode("[1")', "E474:")
call assert_fails('call js_decode("[1,")', "E474:")
call assert_fails('call js_decode("[1 2]")', "E474:")
call assert_fails('call js_decode("[foobar]")', "E491:")
call assert_fails('call js_decode("[")', "E491:")
call assert_fails('call js_decode("[1")', "E491:")
call assert_fails('call js_decode("[1,")', "E491:")
call assert_fails('call js_decode("[1 2]")', "E491:")
call assert_equal(s:varl5, js_decode(s:jsl5))
endfunc