From 18e8833c8b6654aa995cf77461c4cab1fc3ae53a Mon Sep 17 00:00:00 2001 From: kazukazuinaina Date: Sat, 1 Oct 2022 20:33:01 +0900 Subject: [PATCH 1/2] [add] some test in filetype --- test/filetype.vim | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/filetype.vim b/test/filetype.vim index f070a0a..02ec410 100644 --- a/test/filetype.vim +++ b/test/filetype.vim @@ -9,6 +9,10 @@ function! s:Assert(filename, icon) call s:assert.equals(WebDevIconsGetFileTypeSymbol(a:filename), a:icon) endfunction +function! s:suite.NoArgument_GetDefaultIcon() + call s:assert.equals(WebDevIconsGetFileTypeSymbol(), '') +endfunction + function! s:suite.__OneArgument_VimIcon__() let targetfilenames = ['.vimrc', 'vimrc', '.gvimrc', '_gvimrc', 'test.vim'] let expecticon = '' @@ -283,6 +287,22 @@ function! s:suite.OneArgument_PemIcon() call s:assert.equals( WebDevIconsGetFileTypeSymbol('test.pem'), '') endfunction +function! s:suite.TwoArgument_zero_GetFileIcon() + call s:assert.equals( WebDevIconsGetFileTypeSymbol('test.vim', 0), '') +endfunction + +function! s:suite.TwoArgument_one_GetFolderIcon() + call s:assert.equals( WebDevIconsGetFileTypeSymbol('test.vim', 1), '') +endfunction + +function! s:suite.TwoArgument_two_GetDefaultIcon() + call s:assert.equals( WebDevIconsGetFileTypeSymbol("test.vim", 2), '') +endfunction + +function! s:suite.TwoArgument_string_GetFileTypeIcon() + call s:assert.equals( WebDevIconsGetFileTypeSymbol("test.php", "test.vim"), '') +endfunction + function! s:suite.NoArgument_OverWriteFileType_GetVimIcon() set ft=vim call s:assert.equals(WebDevIconsGetFileTypeSymbol(), '') From 37bf8e1872804141921abeeb5700ad57ac957463 Mon Sep 17 00:00:00 2001 From: kazukazuinaina Date: Sat, 1 Oct 2022 22:21:11 +0900 Subject: [PATCH 2/2] [fix] Vint's warning --- test/filetype.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/filetype.vim b/test/filetype.vim index 02ec410..3669ad9 100644 --- a/test/filetype.vim +++ b/test/filetype.vim @@ -296,11 +296,11 @@ function! s:suite.TwoArgument_one_GetFolderIcon() endfunction function! s:suite.TwoArgument_two_GetDefaultIcon() - call s:assert.equals( WebDevIconsGetFileTypeSymbol("test.vim", 2), '') + call s:assert.equals( WebDevIconsGetFileTypeSymbol('test.vim', 2), '') endfunction function! s:suite.TwoArgument_string_GetFileTypeIcon() - call s:assert.equals( WebDevIconsGetFileTypeSymbol("test.php", "test.vim"), '') + call s:assert.equals( WebDevIconsGetFileTypeSymbol('test.php', 'test.vim'), '') endfunction function! s:suite.NoArgument_OverWriteFileType_GetVimIcon()