Mercurial > vim
diff src/testdir/test_vim9_func.vim @ 22155:de47cb7b41e6 v8.2.1627
patch 8.2.1627: Vim9: cannot pass "true" to submatch/term_gettty/term_start
Commit: https://github.com/vim/vim/commit/ad30470610e228e66afb837fdbab6bea36c43de4
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Sep 6 18:22:53 2020 +0200
patch 8.2.1627: Vim9: cannot pass "true" to submatch/term_gettty/term_start
Problem: Vim9: cannot pass "true" to submatch(), term_gettty() and
term_start()
Solution: Use tv_get_bool_chk(). (closes #6888, closes #6890, closes #6889)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 06 Sep 2020 18:30:03 +0200 |
parents | 49b3a95adf04 |
children | ba81f5e300b7 |
line wrap: on
line diff
--- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -1,6 +1,7 @@ " Test various aspects of the Vim9 script language. source check.vim +source term_util.vim source view_util.vim source vim9.vim source screendump.vim @@ -1648,6 +1649,14 @@ def Test_strchars() strchars("A\u20dd", true)->assert_equal(1) enddef +def Test_submatch() + let pat = 'A\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)' + let Rep = {-> range(10)->map({_, v -> submatch(v, true)})->string()} + let actual = substitute('A123456789', pat, Rep, '') + let expected = "[['A123456789'], ['1'], ['2'], ['3'], ['4'], ['5'], ['6'], ['7'], ['8'], ['9']]" + assert_equal(expected, actual) +enddef + def Test_synID() new setline(1, "text") @@ -1655,6 +1664,20 @@ def Test_synID() bwipe! enddef +def Test_term_gettty() + let buf = Run_shell_in_terminal({}) + assert_notequal('', term_gettty(buf, true)) + StopShellInTerminal(buf) +enddef + +def Test_term_start() + botright new + let winnr = winnr() + term_start(&shell, #{curwin: true}) + assert_equal(winnr, winnr()) + bwipe! +enddef + def Test_win_splitmove() split win_splitmove(1, 2, #{vertical: true, rightbelow: true})