aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Anders <8965202+gpanders@users.noreply.github.com>2023-07-10 11:55:12 -0500
committerGitHub <noreply@github.com>2023-07-10 11:55:12 -0500
commit3750e5ed9c740a4334628c4a560d77c1dc2d0bfd (patch)
tree022d9e8e9b333eb9803b88e23f1ced29c0d51d93
parent766f4978d6cb146511cf0b676c01e5327db46647 (diff)
downloadrneovim-3750e5ed9c740a4334628c4a560d77c1dc2d0bfd.tar.gz
rneovim-3750e5ed9c740a4334628c4a560d77c1dc2d0bfd.tar.bz2
rneovim-3750e5ed9c740a4334628c4a560d77c1dc2d0bfd.zip
vim-patch:9.0.1673: cannot produce a status 418 or 503 message (#24287)
Problem: Cannot produce a status 418 or 503 message. Solution: Add err_teapot(). https://github.com/vim/vim/commit/80adaa8ae8398403ca4e9797219ea9a501fc76a5 Co-authored-by: Bram Moolenaar <Bram@vim.org>
-rw-r--r--runtime/doc/vim_diff.txt1
-rw-r--r--test/old/testdir/test_functions.vim15
2 files changed, 16 insertions, 0 deletions
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index 68ebb8cc94..5246d3c2b8 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -598,6 +598,7 @@ Cscope:
Eval:
Vim9script
*cscope_connection()*
+ *err_teapot()*
*js_encode()*
*js_decode()*
*v:none* (used by Vim to represent JavaScript "undefined"); use |v:null| instead.
diff --git a/test/old/testdir/test_functions.vim b/test/old/testdir/test_functions.vim
index 0fca0e322e..74f9143ca0 100644
--- a/test/old/testdir/test_functions.vim
+++ b/test/old/testdir/test_functions.vim
@@ -31,10 +31,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))
@@ -83,6 +86,18 @@ func Test_empty()
call assert_equal(0, empty(function('Test_empty', [0])))
endfunc
+func Test_err_teapot()
+ throw 'Skipped: Nvim does not have 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_len()
call assert_equal(1, len(0))
call assert_equal(2, len(12))