Mercurial > vim
diff src/testing.c @ 19102:ba9f50bfda83 v8.2.0111
patch 8.2.0111: VAR_SPECIAL is also used for booleans
Commit: https://github.com/vim/vim/commit/9b4a15d5dba354d2e1e02871470bad103f34769a
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 11 16:05:23 2020 +0100
patch 8.2.0111: VAR_SPECIAL is also used for booleans
Problem: VAR_SPECIAL is also used for booleans.
Solution: Add VAR_BOOL for better type checking.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 11 Jan 2020 16:15:04 +0100 |
parents | 847cc7932c42 |
children | 94eda51ba9ba |
line wrap: on
line diff
--- a/src/testing.c +++ b/src/testing.c @@ -222,7 +222,7 @@ assert_bool(typval_T *argvars, int isTru 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, typva case VAR_UNKNOWN: case VAR_NUMBER: case VAR_FLOAT: + case VAR_BOOL: case VAR_SPECIAL: case VAR_STRING: break;