Mercurial > vim
comparison src/testdir/test_vim9_builtin.vim @ 28846:0541b9c09e21 v8.2.4946
patch 8.2.4946: Vim9: some code not covered by tests
Commit: https://github.com/vim/vim/commit/7f8a3b11bfc02f24dfd877d0a81392d679008180
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu May 12 22:03:01 2022 +0100
patch 8.2.4946: Vim9: some code not covered by tests
Problem: Vim9: some code not covered by tests.
Solution: Add a few more test cases. Remove dead code.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 12 May 2022 23:15:03 +0200 |
parents | bf013128ccf4 |
children | c5862dfaf0bd |
comparison
equal
deleted
inserted
replaced
28845:8855a6ea2068 | 28846:0541b9c09e21 |
---|---|
76 endif | 76 endif |
77 enddef | 77 enddef |
78 | 78 |
79 def Test_add() | 79 def Test_add() |
80 v9.CheckDefAndScriptFailure(['add({}, 1)'], ['E1013: Argument 1: type mismatch, expected list<any> but got dict<unknown>', 'E1226: List or Blob required for argument 1']) | 80 v9.CheckDefAndScriptFailure(['add({}, 1)'], ['E1013: Argument 1: type mismatch, expected list<any> but got dict<unknown>', 'E1226: List or Blob required for argument 1']) |
81 v9.CheckDefAndScriptFailure(['add([])'], 'E119:') | |
81 v9.CheckDefExecFailure([ | 82 v9.CheckDefExecFailure([ |
82 'var ln: list<number> = [1]', | 83 'var ln: list<number> = [1]', |
83 'add(ln, "a")'], | 84 'add(ln, "a")'], |
84 'E1012: Type mismatch; expected number but got string') | 85 'E1012: Type mismatch; expected number but got string') |
85 assert_equal([1, 'a'], add([1], 'a')) | 86 assert_equal([1, 'a'], add([1], 'a')) |