Mercurial > vim
comparison src/testdir/test_assert.vim @ 22165:c512e6f57ff2 v8.2.1632
patch 8.2.1632: not checking the context of test_fails()
Commit: https://github.com/vim/vim/commit/44d6652d561d628d12e3ff7f6636ea7d1f805ced
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Sep 6 22:26:57 2020 +0200
patch 8.2.1632: not checking the context of test_fails()
Problem: Not checking the context of test_fails().
Solution: Add the line number and context arguments. Give error if
assert_fails() argument types are wrong.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 06 Sep 2020 22:30:03 +0200 |
parents | ff21e2962490 |
children | 006b8ab9d554 |
comparison
equal
deleted
inserted
replaced
22164:7b7500b8b68e | 22165:c512e6f57ff2 |
---|---|
267 call assert_equal(1, assert_fails('xxx', #{one: 1})) | 267 call assert_equal(1, assert_fails('xxx', #{one: 1})) |
268 catch | 268 catch |
269 let exp = v:exception | 269 let exp = v:exception |
270 endtry | 270 endtry |
271 call assert_match("E856: assert_fails() second argument", exp) | 271 call assert_match("E856: assert_fails() second argument", exp) |
272 | |
273 try | |
274 call assert_equal(1, assert_fails('xxx', 'E492', '', 'burp')) | |
275 catch | |
276 let exp = v:exception | |
277 endtry | |
278 call assert_match("E1115: assert_fails() fourth argument must be a number", exp) | |
279 | |
280 try | |
281 call assert_equal(1, assert_fails('xxx', 'E492', '', 54, 123)) | |
282 catch | |
283 let exp = v:exception | |
284 endtry | |
285 call assert_match("E1116: assert_fails() fifth argument must be a string", exp) | |
272 endfunc | 286 endfunc |
273 | 287 |
274 func Test_assert_fails_in_try_block() | 288 func Test_assert_fails_in_try_block() |
275 try | 289 try |
276 call assert_equal(0, assert_fails('throw "error"')) | 290 call assert_equal(0, assert_fails('throw "error"')) |