diff src/testdir/test_filetype.vim @ 32477:0a0b9371957f v9.0.1570

patch 9.0.1570: some tests are slow Commit: https://github.com/vim/vim/commit/bf63011a52a3cc32609ae5945665875062a5ae50 Author: Bram Moolenaar <Bram@vim.org> Date: Fri May 19 21:41:02 2023 +0100 patch 9.0.1570: some tests are slow Problem: Some tests are slow. Solution: Make a few test cases faster.
author Bram Moolenaar <Bram@vim.org>
date Fri, 19 May 2023 22:45:03 +0200
parents 89abdbbfb27d
children 5bf4fd26c9ac
line wrap: on
line diff
--- a/src/testdir/test_filetype.vim
+++ b/src/testdir/test_filetype.vim
@@ -704,27 +704,29 @@ let s:filename_case_checks = {
     \ 'bzl': ['file.BUILD', 'BUILD'],
     \ }
 
-func CheckItems(checks)
+def CheckItems(checks: dict<list<string>>)
   set noswapfile
-  for [ft, names] in items(a:checks)
+
+  for [ft, names] in items(checks)
     for i in range(0, len(names) - 1)
       new
       try
-        exe 'edit ' . fnameescape(names[i])
+        exe 'edit ' .. fnameescape(names[i])
       catch
-	call assert_report('cannot edit "' . names[i] . '": ' . v:exception)
+	assert_report('cannot edit "' .. names[i] .. '": ' .. v:exception)
       endtry
       if &filetype == '' && &readonly
-	" File exists but not able to edit it (permission denied)
+	# File exists but not able to edit it (permission denied)
       else
-        let expected = ft == 'none' ? '' : ft
-	call assert_equal(expected, &filetype, 'with file name: ' . names[i])
+        var expected = ft == 'none' ? '' : ft
+	assert_equal(expected, &filetype, 'with file name: ' .. names[i])
       endif
       bwipe!
     endfor
   endfor
+
   set swapfile&
-endfunc
+enddef
 
 func Test_filetype_detection()
   filetype on