summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_textprop.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-09-03 22:33:44 +0200
committerBram Moolenaar <Bram@vim.org>2020-09-03 22:33:44 +0200
commiteb24556df3b16a19009ee3ddee8ae94dc058a3b2 (patch)
tree427a96ce7432b3fa604dc62885b56be786a9d416 /src/testdir/test_textprop.vim
parent18eedfa40b45b1de955d61417e9918ef7d6e83f9 (diff)
patch 8.2.1584: Vim9: cannot use "true" for "skipstart" in prop_find()v8.2.1584
Problem: Vim9: cannot use "true" for "skipstart" in prop_find(). Solution: Use dict_get_bool() instead of tv_get_number(). (closes #6852)
Diffstat (limited to 'src/testdir/test_textprop.vim')
-rw-r--r--src/testdir/test_textprop.vim25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim
index 5990fbf3f1..bacb288c52 100644
--- a/src/testdir/test_textprop.vim
+++ b/src/testdir/test_textprop.vim
@@ -212,22 +212,27 @@ func Test_prop_find()
call prop_clear(1,6)
call prop_type_delete('prop_name')
- " Multiple props per line, start on the first, should find the second.
- let expected = {'lnum': 1, 'id': 0, 'col': 14, 'end': 1, 'type': 'misspell', 'length': 2, 'start': 1}
- eval ['the quikc bronw fox jumsp over the layz dog']->repeat(2)->setline(1)
- call prop_type_add('misspell', #{highlight: 'ErrorMsg'})
+ bwipe!
+endfunc
+
+def Test_prop_find2()
+ # Multiple props per line, start on the first, should find the second.
+ new
+ ['the quikc bronw fox jumsp over the layz dog']->repeat(2)->setline(1)
+ prop_type_add('misspell', #{highlight: 'ErrorMsg'})
for lnum in [1, 2]
for col in [8, 14, 24, 38]
- call prop_add(lnum, col, #{type: 'misspell', length: 2})
+ prop_add(lnum, col, #{type: 'misspell', length: 2})
endfor
endfor
- call cursor(1, 8)
- let result = prop_find(#{type: 'misspell', skipstart: 1}, 'f')
- call assert_equal(expected, result)
+ cursor(1, 8)
+ let expected = {'lnum': 1, 'id': 0, 'col': 14, 'end': 1, 'type': 'misspell', 'length': 2, 'start': 1}
+ let result = prop_find(#{type: 'misspell', skipstart: true}, 'f')
+ assert_equal(expected, result)
- call prop_type_delete('misspell')
+ prop_type_delete('misspell')
bwipe!
-endfunc
+enddef
func Test_prop_find_smaller_len_than_match_col()
new