diff src/testdir/test_vim9_expr.vim @ 19583:ba35daca6553 v8.2.0348

patch 8.2.0348: Vim9: not all code tested Commit: https://github.com/vim/vim/commit/5381c7a1628eeca81a46b811158be4cd47ba5815 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Mar 2 22:53:32 2020 +0100 patch 8.2.0348: Vim9: not all code tested Problem: Vim9: not all code tested. Solution: Add a few more tests. fix using "b:" in literal dictionary.
author Bram Moolenaar <Bram@vim.org>
date Mon, 02 Mar 2020 23:00:06 +0100
parents 8eeec8886c02
children fc3cdc819d80
line wrap: on
line diff
--- a/src/testdir/test_vim9_expr.vim
+++ b/src/testdir/test_vim9_expr.vim
@@ -37,9 +37,9 @@ def Test_expr1()
     assert_equal('one', 0.1 ? 'one' : 'two')
   endif
   assert_equal('one', 'x' ? 'one' : 'two')
-"  assert_equal('one', 0z1234 ? 'one' : 'two')
+  assert_equal('one', 0z1234 ? 'one' : 'two')
   assert_equal('one', [0] ? 'one' : 'two')
-"  assert_equal('one', #{x: 0} ? 'one' : 'two')
+  assert_equal('one', #{x: 0} ? 'one' : 'two')
   let var = 1
   assert_equal('one', var ? 'one' : 'two')
 
@@ -49,9 +49,9 @@ def Test_expr1()
     assert_equal('two', 0.0 ? 'one' : 'two')
   endif
   assert_equal('two', '' ? 'one' : 'two')
-"  assert_equal('one', 0z ? 'one' : 'two')
+  assert_equal('two', 0z ? 'one' : 'two')
   assert_equal('two', [] ? 'one' : 'two')
-"  assert_equal('two', {} ? 'one' : 'two')
+  assert_equal('two', {} ? 'one' : 'two')
   var = 0
   assert_equal('two', var ? 'one' : 'two')
 enddef
@@ -447,6 +447,11 @@ func Test_expr4_fails()
   call CheckDefFailure("let x = [13] <= [88]", 'Cannot compare list with list')
   call CheckDefFailure("let x = [13] =~ [88]", 'Cannot compare list with list')
   call CheckDefFailure("let x = [13] !~ [88]", 'Cannot compare list with list')
+
+  call CheckDefFailureMult(['let j: job', 'let chan: channel', 'let r = j == chan'], 'Cannot compare job with channel')
+  call CheckDefFailureMult(['let j: job', 'let x: list<any>', 'let r = j == x'], 'Cannot compare job with list')
+  call CheckDefFailureMult(['let j: job', 'let x: func', 'let r = j == x'], 'Cannot compare job with func')
+  call CheckDefFailureMult(['let j: job', 'let x: partial', 'let r = j == x'], 'Cannot compare job with partial')
 endfunc
 
 " test addition, subtraction, concatenation