From f03dd22f0d37af88f40a27c694c3265026178e80 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Sat, 7 Aug 2021 01:08:22 +0100 Subject: vim-patch:8.1.1835: cannot use printf() as a method Problem: Cannot use printf() as a method. Solution: Pass the base as the second argument to printf(). https://github.com/vim/vim/commit/fd8ca21b3ff207e44891aef922935d4adcd140cf --- src/nvim/testdir/test_method.vim | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/nvim/testdir/test_method.vim') diff --git a/src/nvim/testdir/test_method.vim b/src/nvim/testdir/test_method.vim index 4788f211e8..eeb90cd16a 100644 --- a/src/nvim/testdir/test_method.vim +++ b/src/nvim/testdir/test_method.vim @@ -72,13 +72,15 @@ func Test_dict_method() endfunc func Test_string_method() - call assert_equal(['1', '2', '3'], '1 2 3'->split()) - call assert_equal([1, 2, 3], '1 2 3'->split()->map({i, v -> str2nr(v)})) - call assert_equal([65, 66, 67], 'ABC'->str2list()) - call assert_equal(3, 'ABC'->strlen()) - call assert_equal('a^Mb^[c', "a\rb\ec"->strtrans()) - call assert_equal(4, "aあb"->strwidth()) - call assert_equal('axc', 'abc'->substitute('b', 'x', '')) + eval '1 2 3'->split()->assert_equal(['1', '2', '3']) + eval '1 2 3'->split()->map({i, v -> str2nr(v)})->assert_equal([1, 2, 3]) + eval 'ABC'->str2list()->assert_equal([65, 66, 67]) + eval 'ABC'->strlen()->assert_equal(3) + eval "a\rb\ec"->strtrans()->assert_equal('a^Mb^[c') + eval "aあb"->strwidth()->assert_equal(4) + eval 'abc'->substitute('b', 'x', '')->assert_equal('axc') + + eval 'abc'->printf('the %s arg')->assert_equal('the abc arg') endfunc func Test_method_append() -- cgit