Mercurial > vim
diff src/testdir/test_functions.vim @ 32685:3868e8035b8c v9.0.1673
patch 9.0.1673: cannot produce a status 418 or 503 message
Commit: https://github.com/vim/vim/commit/80adaa8ae8398403ca4e9797219ea9a501fc76a5
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jul 7 18:57:40 2023 +0100
patch 9.0.1673: cannot produce a status 418 or 503 message
Problem: Cannot produce a status 418 or 503 message.
Solution: Add err_teapot().
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 07 Jul 2023 20:00:05 +0200 |
parents | 695b50472e85 |
children | 939396a5711c |
line wrap: on
line diff
--- a/src/testdir/test_functions.vim +++ b/src/testdir/test_functions.vim @@ -30,10 +30,13 @@ func Test_has() call assert_equal(1, or(has('ttyin'), 1)) call assert_equal(0, and(has('ttyout'), 0)) call assert_equal(1, has('multi_byte_encoding')) + call assert_equal(0, has(':tearoff')) endif call assert_equal(1, has('vcon', 1)) call assert_equal(1, has('mouse_gpm_enabled', 1)) + call assert_equal(has('gui_win32') && has('menu'), has(':tearoff')) + call assert_equal(0, has('nonexistent')) call assert_equal(0, has('nonexistent', 1)) @@ -86,6 +89,17 @@ func Test_empty() call assert_fails("call empty(test_unknown())", ['E340:', 'E685:']) endfunc +func Test_err_teapot() + call assert_fails('call err_teapot()', "E418: I'm a teapot") + call assert_fails('call err_teapot(0)', "E418: I'm a teapot") + call assert_fails('call err_teapot(v:false)', "E418: I'm a teapot") + + call assert_fails('call err_teapot("1")', "E503: Coffee is currently not available") + call assert_fails('call err_teapot(v:true)', "E503: Coffee is currently not available") + let expr = 1 + call assert_fails('call err_teapot(expr)', "E503: Coffee is currently not available") +endfunc + func Test_test_void() call assert_fails('echo 1 == test_void()', 'E1031:') call assert_fails('echo 1.0 == test_void()', 'E1031:')