comparison src/testdir/test_vim9_func.vim @ 22055:88bedbb4ba75 v8.2.1577

patch 8.2.1577: Vim9: hasmapto()/mapcheck()/maparg() do nottake "true" arg Commit: https://github.com/vim/vim/commit/04d594b9c14299ed50da0774fb8d3a10fbc4076f Author: Bram Moolenaar <Bram@vim.org> Date: Wed Sep 2 22:25:35 2020 +0200 patch 8.2.1577: Vim9: hasmapto()/mapcheck()/maparg() do nottake "true" arg Problem: Vim9: hasmapto(), mapcheck() and maparg() do not take "true" as argument. Solution: Use tv_get_bool(). (closes #6822, closes #6824)
author Bram Moolenaar <Bram@vim.org>
date Wed, 02 Sep 2020 22:30:03 +0200
parents 0794909e2988
children 2b9a2bc77b42
comparison
equal deleted inserted replaced
22054:a7d9a93a4d80 22055:88bedbb4ba75
1519 1519
1520 def Test_globpath() 1520 def Test_globpath()
1521 assert_equal(['./runtest.vim'], globpath('.', 'runtest.vim', true, true, true)) 1521 assert_equal(['./runtest.vim'], globpath('.', 'runtest.vim', true, true, true))
1522 enddef 1522 enddef
1523 1523
1524 def Test_hasmapto()
1525 assert_equal(0, hasmapto('foobar', 'i', true))
1526 iabbrev foo foobar
1527 assert_equal(1, hasmapto('foobar', 'i', true))
1528 iunabbrev foo
1529 enddef
1530
1531 def SID(): number
1532 return expand('<SID>')
1533 ->matchstr('<SNR>\zs\d\+\ze_$')
1534 ->str2nr()
1535 enddef
1536
1537 def Test_maparg()
1538 let lnum = str2nr(expand('<sflnum>'))
1539 map foo bar
1540 assert_equal(#{
1541 lnum: lnum + 1,
1542 script: 0,
1543 mode: ' ',
1544 silent: 0,
1545 noremap: 0,
1546 lhs: 'foo',
1547 lhsraw: 'foo',
1548 nowait: 0,
1549 expr: 0,
1550 sid: SID(),
1551 rhs: 'bar',
1552 buffer: 0},
1553 maparg('foo', '', false, true))
1554 unmap foo
1555 enddef
1556
1557 def Test_mapcheck()
1558 iabbrev foo foobar
1559 assert_equal('foobar', mapcheck('foo', 'i', true))
1560 iunabbrev foo
1561 enddef
1562
1524 def Test_recursive_call() 1563 def Test_recursive_call()
1525 assert_equal(6765, Fibonacci(20)) 1564 assert_equal(6765, Fibonacci(20))
1526 enddef 1565 enddef
1527 1566
1528 def TreeWalk(dir: string): list<any> 1567 def TreeWalk(dir: string): list<any>