patch 9.1.0419: eval.c not sufficiently tested

Problem:  eval.c not sufficiently tested
Solution: Add a few more additional tests for eval.c,
          (Yegappan Lakshmanan)

closes: #14799

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/eval.c b/src/eval.c
index 322b45a..8cc6ed1 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -2979,7 +2979,7 @@
 	    char_u *nl = vim_strchr(p, NL);
 
 	    if (nl == NULL)
-		    break;
+		break;
 	    p = nl;
 	}
 	if (*p != NL)
@@ -4509,18 +4509,21 @@
 	case 9:
 		if (STRNCMP(s, "null_", 5) != 0)
 		    break;
+		// null_list
 		if (STRNCMP(s + 5, "list", 4) == 0)
 		{
 		    rettv->v_type = VAR_LIST;
 		    rettv->vval.v_list = NULL;
 		    return OK;
 		}
+		// null_dict
 		if (STRNCMP(s + 5, "dict", 4) == 0)
 		{
 		    rettv->v_type = VAR_DICT;
 		    rettv->vval.v_dict = NULL;
 		    return OK;
 		}
+		// null_blob
 		if (STRNCMP(s + 5, "blob", 4) == 0)
 		{
 		    rettv->v_type = VAR_BLOB;
diff --git a/src/testdir/test_autoload.vim b/src/testdir/test_autoload.vim
index 835b81e..d0f9136 100644
--- a/src/testdir/test_autoload.vim
+++ b/src/testdir/test_autoload.vim
@@ -26,5 +26,4 @@
   call assert_equal(49, auto9#Add42(7))
 endfunc
 
-
 " vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/testdir/test_fold.vim b/src/testdir/test_fold.vim
index 7184142..871d427 100644
--- a/src/testdir/test_fold.vim
+++ b/src/testdir/test_fold.vim
Binary files differ
diff --git a/src/testdir/test_spellrare.vim b/src/testdir/test_spellrare.vim
index bbb13c2..ceb35cb 100644
--- a/src/testdir/test_spellrare.vim
+++ b/src/testdir/test_spellrare.vim
@@ -11,15 +11,15 @@
   " Create a small word list to test that spellbadword('...')
   " can return ['...', 'rare'].
   let lines =<< trim END
-     foo
-     foobar/?
-     foobara/?
-END
-   call writefile(lines, 'Xwords', 'D')
+    foo
+    foobar/?
+    foobara/?
+  END
+  call writefile(lines, 'Xwords', 'D')
 
-   mkspell! Xwords.spl Xwords
-   set spelllang=Xwords.spl
-   call assert_equal(['foobar', 'rare'], spellbadword('foo foobar'))
+  mkspell! Xwords.spl Xwords
+  set spelllang=Xwords.spl
+  call assert_equal(['foobar', 'rare'], spellbadword('foo foobar'))
 
   new
   call setline(1, ['foo', '', 'foo bar foo bar foobara foo foo foo foobar', '', 'End'])
diff --git a/src/testdir/test_substitute.vim b/src/testdir/test_substitute.vim
index 7c2bbb4..cf2c73f 100644
--- a/src/testdir/test_substitute.vim
+++ b/src/testdir/test_substitute.vim
@@ -1498,4 +1498,18 @@
   exe bufnr .. "bw!"
 endfunc
 
+" Test for changing 'cpo' in a substitute expression
+func Test_substitute_expr_cpo()
+  func XSubExpr()
+    set cpo=
+    return 'x'
+  endfunc
+
+  let save_cpo = &cpo
+  call assert_equal('xxx', substitute('abc', '.', '\=XSubExpr()', 'g'))
+  call assert_equal(save_cpo, &cpo)
+
+  delfunc XSubExpr
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/testdir/test_vim9_builtin.vim b/src/testdir/test_vim9_builtin.vim
index ba3b76a..3200b73 100644
--- a/src/testdir/test_vim9_builtin.vim
+++ b/src/testdir/test_vim9_builtin.vim
@@ -960,6 +960,8 @@
   assert_equal("\nhello", res)
   res = execute(["echo 'here'", "echo 'there'"])
   assert_equal("\nhere\nthere", res)
+  res = execute("echo 'hi'\n# foo")
+  assert_equal("\nhi", res)
 
   v9.CheckSourceDefAndScriptFailure(['execute(123)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1222: String or List required for argument 1'])
   v9.CheckSourceDefFailure(['execute([123])'], 'E1013: Argument 1: type mismatch, expected list<string> but got list<number>')
diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim
index 523728c..5734731 100644
--- a/src/testdir/test_vim9_expr.vim
+++ b/src/testdir/test_vim9_expr.vim
@@ -2118,6 +2118,12 @@
       Test()
   END
   v9.CheckDefAndScriptSuccess(lines)
+
+  lines =<< trim END
+    vim9script
+    eval("10\n")
+  END
+  v9.CheckSourceScriptFailure(lines, "E488: Trailing characters: \n")
 enddef
 
 def Test_expr9_float()
diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim
index f07c4c9..a640fce 100644
--- a/src/testdir/test_vim9_script.vim
+++ b/src/testdir/test_vim9_script.vim
@@ -2510,6 +2510,11 @@
         reslist->add('x')
       endfor
       assert_equal(['x', 'x', 'x'], reslist)
+
+      # Test for trying to use the loop variable "_" inside the loop
+      for _ in "a"
+        assert_fails('echo _', 'E1181: Cannot use an underscore here')
+      endfor
   END
   v9.CheckDefAndScriptSuccess(lines)
 
diff --git a/src/testdir/test_vimscript.vim b/src/testdir/test_vimscript.vim
index c135304..8976779 100644
--- a/src/testdir/test_vimscript.vim
+++ b/src/testdir/test_vimscript.vim
@@ -7510,12 +7510,13 @@
   endfor
   call assert_equal('', res)
 
-  " Test for ignoring loop var assignment
-  let c = 0
-  for _ in 'abc'
-    let c += 1
+  " Test for using "_" as the loop variable
+  let i = 0
+  let s = 'abc'
+  for _ in s
+    call assert_equal(s[i], _)
+    let i += 1
   endfor
-  call assert_equal(3, c)
 endfunc
 
 " Test for deeply nested :source command  {{{1
diff --git a/src/version.c b/src/version.c
index ad3b585..34f474d 100644
--- a/src/version.c
+++ b/src/version.c
@@ -705,6 +705,8 @@
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    419,
+/**/
     418,
 /**/
     417,