Patch 8.2.5025
Problem:    Vim9: a few lines not covered by tests.
Solution:   Add a few tests.
Files:      src/vim9script.c, src/testdir/test_vim9_assign.vim,
            src/testdir/test_vim9_import.vim


*** ../vim-8.2.5024/src/vim9script.c    2022-05-05 12:20:24.359225499 +0100
--- src/vim9script.c    2022-05-26 19:41:57.504524524 +0100
***************
*** 804,810 ****
  }
  
  /*
!  * Declare a script-local variable without init: "let var: type".
   * "const" is an error since the value is missing.
   * Returns a pointer to after the type.
   */
--- 804,810 ----
  }
  
  /*
!  * Declare a script-local variable without init: "var name: type".
   * "const" is an error since the value is missing.
   * Returns a pointer to after the type.
   */
*** ../vim-8.2.5024/src/testdir/test_vim9_assign.vim    2022-05-06 
17:53:02.685329543 +0100
--- src/testdir/test_vim9_assign.vim    2022-05-26 19:51:12.128091869 +0100
***************
*** 213,218 ****
--- 213,220 ----
    v9.CheckDefFailure(['var s:var = 123'], 'E1101:')
    v9.CheckDefFailure(['var s:var: number'], 'E1101:')
  
+   v9.CheckDefAndScriptFailure(['var $VAR: number'], ['E1016:', 'E475:'])
+ 
    lines =<< trim END
      vim9script
      def SomeFunc()
*** ../vim-8.2.5024/src/testdir/test_vim9_import.vim    2022-04-24 
21:33:17.038835419 +0100
--- src/testdir/test_vim9_import.vim    2022-05-26 19:40:41.632583477 +0100
***************
*** 312,317 ****
--- 312,325 ----
    writefile(import_no_as_lines, 'Ximport.vim')
    assert_fails('source Ximport.vim', 'E488:', '', 2, 'Ximport.vim')
  
+   # trailing starts with "as"
+   var import_bad_as_lines =<< trim END
+     vim9script
+     import './Xexport.vim' asname
+   END
+   writefile(import_no_as_lines, 'Ximport.vim')
+   assert_fails('source Ximport.vim', 'E488:', '', 2, 'Ximport.vim')
+ 
    var import_invalid_string_lines =<< trim END
      vim9script
      import Xexport.vim
***************
*** 396,401 ****
--- 404,430 ----
    delete('Xvim9_script')
  enddef
  
+ def Test_import_very_long_name()
+   var lines =<< trim END
+       vim9script
+ 
+       export var 
verylongnameverylongnameverylongnameverylongnameverylongnameverylongnameverylongnameverylongnameverylongnameverylongnameverylongnameverylongnameverylongnameverylongnameverylongnameverylongname
 = 'asdf'
+   END
+   writefile(lines, 'Xverylong.vim')
+ 
+   lines =<< trim END
+       vim9script
+       import './Xverylong.vim'
+ 
+       g:result = 
Xverylong.verylongnameverylongnameverylongnameverylongnameverylongnameverylongnameverylongnameverylongnameverylongnameverylongnameverylongnameverylongnameverylongnameverylongnameverylongnameverylongname
+   END
+   v9.CheckScriptSuccess(lines)
+   assert_equal('asdf', g:result)
+ 
+   delete('Xverylong.vim')
+   unlet g:result
+ enddef
+ 
  def Test_import_funcref()
    var lines =<< trim END
        vim9script
***************
*** 712,717 ****
--- 741,756 ----
    nunmap <F3>
  enddef
  
+ def Test_autoload_import_var()
+   # variable name starts with "autoload"
+   var lines =<< trim END
+       vim9script
+       var autoloaded = "Xtest.vim"
+       import autoloaded
+   END
+   v9.CheckScriptFailure(lines, 'E1053: Could not import "Xtest.vim')
+ enddef
+ 
  def Test_use_autoload_import_in_mapping()
    var lines =<< trim END
        vim9script
*** ../vim-8.2.5024/src/version.c       2022-05-26 16:32:40.808137960 +0100
--- src/version.c       2022-05-26 19:17:45.913616961 +0100
***************
*** 736,737 ****
--- 736,739 ----
  {   /* Add new patch number below this line */
+ /**/
+     5025,
  /**/

-- 
You got to work at a mill?  Lucky!  I got sent back to work in the
acid-mines for my daily crust of stale bread... which not even the
birds would eat.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220526185451.D30301C0B4C%40moolenaar.net.

Raspunde prin e-mail lui