mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:7.4.1168 (#19645)
Problem: This doesn't give the right result: eval(string(v:true)). (Nikolay
Pavlov)
Solution: Make the string "v:true" instead of "true".
f48aa160fd
This commit is contained in:
parent
33b49d5f55
commit
02a4974418
@ -30,12 +30,12 @@
|
||||
#include "nvim/vim.h" // For _()
|
||||
|
||||
const char *const encode_bool_var_names[] = {
|
||||
[kBoolVarTrue] = "true",
|
||||
[kBoolVarFalse] = "false",
|
||||
[kBoolVarTrue] = "v:true",
|
||||
[kBoolVarFalse] = "v:false",
|
||||
};
|
||||
|
||||
const char *const encode_special_var_names[] = {
|
||||
[kSpecialVarNull] = "null",
|
||||
[kSpecialVarNull] = "v:null",
|
||||
};
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
|
@ -95,7 +95,7 @@ func Test_exit_code()
|
||||
[CODE]
|
||||
|
||||
if RunVim(before, ['quit'], '')
|
||||
call assert_equal(['qp = null', 'ep = null', 'lp = 0', 'l = 0'], readfile('Xtestout'))
|
||||
call assert_equal(['qp = v:null', 'ep = v:null', 'lp = 0', 'l = 0'], readfile('Xtestout'))
|
||||
endif
|
||||
call delete('Xtestout')
|
||||
|
||||
|
@ -1165,10 +1165,10 @@ func Test_type()
|
||||
" call assert_equal(0, 0 + v:none)
|
||||
call assert_equal(0, 0 + v:null)
|
||||
|
||||
call assert_equal('false', '' . v:false)
|
||||
call assert_equal('true', '' . v:true)
|
||||
" call assert_equal('none', '' . v:none)
|
||||
call assert_equal('null', '' . v:null)
|
||||
call assert_equal('v:false', '' . v:false)
|
||||
call assert_equal('v:true', '' . v:true)
|
||||
" call assert_equal('v:none', '' . v:none)
|
||||
call assert_equal('v:null', '' . v:null)
|
||||
|
||||
call assert_true(v:false == 0)
|
||||
call assert_false(v:false != 0)
|
||||
|
@ -690,8 +690,8 @@ describe('jobs', function()
|
||||
-- jobstart() shares its v:servername with the child via $NVIM.
|
||||
eq('NVIM='..addr, get_env_in_child_job('NVIM'))
|
||||
-- $NVIM_LISTEN_ADDRESS is unset by server_init in the child.
|
||||
eq('NVIM_LISTEN_ADDRESS=null', get_env_in_child_job('NVIM_LISTEN_ADDRESS'))
|
||||
eq('NVIM_LISTEN_ADDRESS=null', get_env_in_child_job('NVIM_LISTEN_ADDRESS',
|
||||
eq('NVIM_LISTEN_ADDRESS=v:null', get_env_in_child_job('NVIM_LISTEN_ADDRESS'))
|
||||
eq('NVIM_LISTEN_ADDRESS=v:null', get_env_in_child_job('NVIM_LISTEN_ADDRESS',
|
||||
{ NVIM_LISTEN_ADDRESS='Xtest_jobstart_env' }))
|
||||
-- User can explicitly set $NVIM_LOG_FILE, $VIM, $VIMRUNTIME.
|
||||
eq('NVIM_LOG_FILE=Xtest_jobstart_env',
|
||||
|
@ -125,9 +125,9 @@ describe('Special values', function()
|
||||
end)
|
||||
|
||||
it('work with . (concat) properly', function()
|
||||
eq("true", eval('"" . v:true'))
|
||||
eq("null", eval('"" . v:null'))
|
||||
eq("false", eval('"" . v:false'))
|
||||
eq("v:true", eval('"" . v:true'))
|
||||
eq("v:null", eval('"" . v:null'))
|
||||
eq("v:false", eval('"" . v:false'))
|
||||
end)
|
||||
|
||||
it('work with type()', function()
|
||||
|
@ -2992,9 +2992,9 @@ describe('typval.c', function()
|
||||
{lib.VAR_FUNC, {v_string=NULL}, 'E729: using Funcref as a String', ''},
|
||||
{lib.VAR_LIST, {v_list=NULL}, 'E730: using List as a String', ''},
|
||||
{lib.VAR_DICT, {v_dict=NULL}, 'E731: using Dictionary as a String', ''},
|
||||
{lib.VAR_SPECIAL, {v_special=lib.kSpecialVarNull}, nil, 'null'},
|
||||
{lib.VAR_BOOL, {v_bool=lib.kBoolVarTrue}, nil, 'true'},
|
||||
{lib.VAR_BOOL, {v_bool=lib.kBoolVarFalse}, nil, 'false'},
|
||||
{lib.VAR_SPECIAL, {v_special=lib.kSpecialVarNull}, nil, 'v:null'},
|
||||
{lib.VAR_BOOL, {v_bool=lib.kBoolVarTrue}, nil, 'v:true'},
|
||||
{lib.VAR_BOOL, {v_bool=lib.kBoolVarFalse}, nil, 'v:false'},
|
||||
{lib.VAR_UNKNOWN, nil, 'E908: using an invalid value as a String', ''},
|
||||
}) do
|
||||
-- Using to_cstr in place of Neovim allocated string, cannot
|
||||
@ -3036,9 +3036,9 @@ describe('typval.c', function()
|
||||
{lib.VAR_FUNC, {v_string=NULL}, 'E729: using Funcref as a String', nil},
|
||||
{lib.VAR_LIST, {v_list=NULL}, 'E730: using List as a String', nil},
|
||||
{lib.VAR_DICT, {v_dict=NULL}, 'E731: using Dictionary as a String', nil},
|
||||
{lib.VAR_SPECIAL, {v_special=lib.kSpecialVarNull}, nil, 'null'},
|
||||
{lib.VAR_BOOL, {v_bool=lib.kBoolVarTrue}, nil, 'true'},
|
||||
{lib.VAR_BOOL, {v_bool=lib.kBoolVarFalse}, nil, 'false'},
|
||||
{lib.VAR_SPECIAL, {v_special=lib.kSpecialVarNull}, nil, 'v:null'},
|
||||
{lib.VAR_BOOL, {v_bool=lib.kBoolVarTrue}, nil, 'v:true'},
|
||||
{lib.VAR_BOOL, {v_bool=lib.kBoolVarFalse}, nil, 'v:false'},
|
||||
{lib.VAR_UNKNOWN, nil, 'E908: using an invalid value as a String', nil},
|
||||
}) do
|
||||
-- Using to_cstr, cannot free with tv_clear
|
||||
@ -3078,9 +3078,9 @@ describe('typval.c', function()
|
||||
{lib.VAR_FUNC, {v_string=NULL}, 'E729: using Funcref as a String', ''},
|
||||
{lib.VAR_LIST, {v_list=NULL}, 'E730: using List as a String', ''},
|
||||
{lib.VAR_DICT, {v_dict=NULL}, 'E731: using Dictionary as a String', ''},
|
||||
{lib.VAR_SPECIAL, {v_special=lib.kSpecialVarNull}, nil, 'null'},
|
||||
{lib.VAR_BOOL, {v_bool=lib.kBoolVarTrue}, nil, 'true'},
|
||||
{lib.VAR_BOOL, {v_bool=lib.kBoolVarFalse}, nil, 'false'},
|
||||
{lib.VAR_SPECIAL, {v_special=lib.kSpecialVarNull}, nil, 'v:null'},
|
||||
{lib.VAR_BOOL, {v_bool=lib.kBoolVarTrue}, nil, 'v:true'},
|
||||
{lib.VAR_BOOL, {v_bool=lib.kBoolVarFalse}, nil, 'v:false'},
|
||||
{lib.VAR_UNKNOWN, nil, 'E908: using an invalid value as a String', ''},
|
||||
}) do
|
||||
-- Using to_cstr, cannot free with tv_clear
|
||||
@ -3121,9 +3121,9 @@ describe('typval.c', function()
|
||||
{lib.VAR_FUNC, {v_string=NULL}, 'E729: using Funcref as a String', nil},
|
||||
{lib.VAR_LIST, {v_list=NULL}, 'E730: using List as a String', nil},
|
||||
{lib.VAR_DICT, {v_dict=NULL}, 'E731: using Dictionary as a String', nil},
|
||||
{lib.VAR_SPECIAL, {v_special=lib.kSpecialVarNull}, nil, 'null'},
|
||||
{lib.VAR_BOOL, {v_bool=lib.kBoolVarTrue}, nil, 'true'},
|
||||
{lib.VAR_BOOL, {v_bool=lib.kBoolVarFalse}, nil, 'false'},
|
||||
{lib.VAR_SPECIAL, {v_special=lib.kSpecialVarNull}, nil, 'v:null'},
|
||||
{lib.VAR_BOOL, {v_bool=lib.kBoolVarTrue}, nil, 'v:true'},
|
||||
{lib.VAR_BOOL, {v_bool=lib.kBoolVarFalse}, nil, 'v:false'},
|
||||
{lib.VAR_UNKNOWN, nil, 'E908: using an invalid value as a String', nil},
|
||||
}) do
|
||||
-- Using to_cstr, cannot free with tv_clear
|
||||
|
Loading…
Reference in New Issue
Block a user