summaryrefslogtreecommitdiff
path: root/src/testing.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-01-11 16:05:23 +0100
committerBram Moolenaar <Bram@vim.org>2020-01-11 16:05:23 +0100
commit9b4a15d5dba354d2e1e02871470bad103f34769a (patch)
treee5e49ad3182e07e641cdea0e04c4a8078186c58c /src/testing.c
parente05a89ac6399a8c7d164c99fdab6841d999a9128 (diff)
downloadvim-git-9b4a15d5dba354d2e1e02871470bad103f34769a.tar.gz
patch 8.2.0111: VAR_SPECIAL is also used for booleansv8.2.0111
Problem: VAR_SPECIAL is also used for booleans. Solution: Add VAR_BOOL for better type checking.
Diffstat (limited to 'src/testing.c')
-rw-r--r--src/testing.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/testing.c b/src/testing.c
index 3e6ba8e03..ac9beea43 100644
--- a/src/testing.c
+++ b/src/testing.c
@@ -222,7 +222,7 @@ assert_bool(typval_T *argvars, int isTrue)
int error = FALSE;
garray_T ga;
- if (argvars[0].v_type == VAR_SPECIAL
+ if (argvars[0].v_type == VAR_BOOL
&& argvars[0].vval.v_number == (isTrue ? VVAL_TRUE : VVAL_FALSE))
return 0;
if (argvars[0].v_type != VAR_NUMBER
@@ -760,6 +760,7 @@ f_test_refcount(typval_T *argvars, typval_T *rettv)
case VAR_UNKNOWN:
case VAR_NUMBER:
case VAR_FLOAT:
+ case VAR_BOOL:
case VAR_SPECIAL:
case VAR_STRING:
break;