Просмотр исходного кода

Add test for the MRUToggle command

Yegappan Lakshmanan 4 лет назад
Родитель
Сommit
33573a1fbc
1 измененных файлов с 30 добавлено и 0 удалено
  1. 30 0
      test/unit_tests.vim

+ 30 - 0
test/unit_tests.vim

@@ -1563,6 +1563,36 @@ func Test_53()
   call LogResult(test_name, 'pass')
 endfunc
 
+" ==========================================================================
+" Test54
+" Test for the :MRUToggle command.
+" ==========================================================================
+func Test_54()
+  let test_name = 'test54'
+  %bw!
+  " open the MRU window
+  MRUToggle
+  if bufwinnr(g:MRU_buffer_name) != 2 || winnr() != 2
+    call LogResult(test_name, 'FAIL (1)')
+    return
+  endif
+  " close the MRU window
+  MRUToggle
+  if bufwinnr(g:MRU_buffer_name) != -1 || winnr() != 1
+    call LogResult(test_name, 'FAIL (2)')
+    return
+  endif
+  " close the MRU window from some other window
+  MRUToggle
+  wincmd k
+  MRUToggle
+  if bufwinnr(g:MRU_buffer_name) != -1 || winnr() != 1
+    call LogResult(test_name, 'FAIL (3)')
+    return
+  endif
+  call LogResult(test_name, 'pass')
+endfunc
+
 " ==========================================================================
 
 " Create the files used by the tests