summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_vim9_expr.vim
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 07:39:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 07:39:41 +0000
commit00c068502d170f9f9b59c4a68aa12e8835859f6c (patch)
tree2047fc01b8c70326d9b87b47a575e7e5f2141b62 /src/testdir/test_vim9_expr.vim
parentAdding upstream version 2:9.1.0016. (diff)
downloadvim-00c068502d170f9f9b59c4a68aa12e8835859f6c.tar.xz
vim-00c068502d170f9f9b59c4a68aa12e8835859f6c.zip
Adding upstream version 2:9.1.0199.upstream/2%9.1.0199
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/testdir/test_vim9_expr.vim')
-rw-r--r--src/testdir/test_vim9_expr.vim27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim
index 6285ba1..7764b37 100644
--- a/src/testdir/test_vim9_expr.vim
+++ b/src/testdir/test_vim9_expr.vim
@@ -311,6 +311,33 @@ def Test_expr2()
assert_equal([1], g:vals)
END
v9.CheckDefAndScriptSuccess(lines)
+
+ # test the short-circuit operation
+ lines =<< trim END
+ assert_equal(true, true && true)
+ assert_equal(false, true && !true)
+ assert_equal(false, !true && true)
+ assert_equal(false, !true && !true)
+
+ assert_equal(true, true || true)
+ assert_equal(true, true || !true)
+ assert_equal(true, !true || true)
+ assert_equal(false, !true || !true)
+
+ assert_equal(false, false && false)
+ assert_equal(false, false && !false)
+ assert_equal(false, !false && false)
+ assert_equal(true, !false && !false)
+
+ assert_equal(false, false || false)
+ assert_equal(true, false || !false)
+ assert_equal(true, !false || false)
+ assert_equal(true, !false || !false)
+
+ assert_equal(false, !true && !true && !true)
+ assert_equal(true, !false || !false || !false)
+ END
+ v9.CheckDefAndScriptSuccess(lines)
enddef
def Test_expr2_vimscript()