From ba023e135b29f85e89f2c3882b9cf313f0e2bd02 Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Sun, 20 Jul 2025 09:55:07 +0200 Subject: [PATCH] patch 9.1.1569: tests: Vim9 tests can be improved Problem: tests: Vim9 tests can be improved Solution: In Test_has_func_shortcircuit(), move the test functions to a separate script (Yegappan Lakshmanan) closes: #17796 Signed-off-by: Yegappan Lakshmanan Signed-off-by: Christian Brabandt --- src/testdir/test_vim9_script.vim | 120 ++++++++++++++++++------------- src/version.c | 2 + 2 files changed, 74 insertions(+), 48 deletions(-) diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim index 268ceb4824..0008f1e51d 100644 --- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -5267,59 +5267,83 @@ enddef " Test for using more than one has() check in a compound if condition. def Test_has_func_shortcircuit() - def Has_And1_Cond(): string - # true && false - if has('jumplist') && has('foobar') - return 'present' - endif - return 'missing' - enddef - assert_equal('missing', Has_And1_Cond()) + var lines =<< trim END + vim9script + def Has_And1_Cond(): string + # true && false + if has('jumplist') && has('foobar') + return 'present' + endif + return 'missing' + enddef + assert_equal('missing', Has_And1_Cond()) + END + v9.CheckSourceSuccess(lines) - def Has_And2_Cond(): string - # false && true - if has('foobar') && has('jumplist') - return 'present' - endif - return 'missing' - enddef - assert_equal('missing', Has_And2_Cond()) + lines =<< trim END + vim9script + def Has_And2_Cond(): string + # false && true + if has('foobar') && has('jumplist') + return 'present' + endif + return 'missing' + enddef + assert_equal('missing', Has_And2_Cond()) + END + v9.CheckSourceSuccess(lines) - def Has_And3_Cond(): string - # false && false - if has('foobar') && has('foobaz') - return 'present' - endif - return 'missing' - enddef - assert_equal('missing', Has_And3_Cond()) + lines =<< trim END + vim9script + def Has_And3_Cond(): string + # false && false + if has('foobar') && has('foobaz') + return 'present' + endif + return 'missing' + enddef + assert_equal('missing', Has_And3_Cond()) + END + v9.CheckSourceSuccess(lines) - def Has_Or1_Cond(): string - # true || false - if has('jumplist') || has('foobar') - return 'present' - endif - return 'missing' - enddef - assert_equal('present', Has_Or1_Cond()) + lines =<< trim END + vim9script + def Has_Or1_Cond(): string + # true || false + if has('jumplist') || has('foobar') + return 'present' + endif + return 'missing' + enddef + assert_equal('present', Has_Or1_Cond()) + END + v9.CheckSourceSuccess(lines) - def Has_Or2_Cond(): string - # false || true - if has('foobar') || has('jumplist') - return 'present' - endif - return 'missing' - enddef - assert_equal('present', Has_Or2_Cond()) + lines =<< trim END + vim9script + def Has_Or2_Cond(): string + # false || true + if has('foobar') || has('jumplist') + return 'present' + endif + return 'missing' + enddef + assert_equal('present', Has_Or2_Cond()) + END + v9.CheckSourceSuccess(lines) - def Has_Or3_Cond(): string - # false || false - if has('foobar') || has('foobaz') - return 'present' - endif - return 'missing' - enddef - assert_equal('missing', Has_Or3_Cond()) + lines =<< trim END + vim9script + def Has_Or3_Cond(): string + # false || false + if has('foobar') || has('foobaz') + return 'present' + endif + return 'missing' + enddef + assert_equal('missing', Has_Or3_Cond()) + END + v9.CheckSourceSuccess(lines) enddef " Test for using more than one len() function in a compound if condition. diff --git a/src/version.c b/src/version.c index 62f61e4a78..7297bc8cc2 100644 --- a/src/version.c +++ b/src/version.c @@ -719,6 +719,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1569, /**/ 1568, /**/ -- 2.47.2