From f3e6b9ea6da916e8347fb38db3f103e6add524f1 Mon Sep 17 00:00:00 2001 From: kamykn Date: Sat, 23 Nov 2019 01:51:37 +0900 Subject: [PATCH] fix tests --- autoload/spelunker/test/test_toggle.vim | 92 +++++++++++---------- autoload/spelunker/toggle.vim | 30 ++++--- test/unit_test/toggle/is_enabled_1.txt | 3 + test/unit_test/toggle/is_enabled_2.txt | 3 + test/unit_test/toggle/is_enabled_buffer.txt | 3 + test/unit_test/toggle/is_enabled_global.txt | 3 + 6 files changed, 80 insertions(+), 54 deletions(-) create mode 100644 test/unit_test/toggle/is_enabled_1.txt create mode 100644 test/unit_test/toggle/is_enabled_2.txt create mode 100644 test/unit_test/toggle/is_enabled_buffer.txt create mode 100644 test/unit_test/toggle/is_enabled_global.txt diff --git a/autoload/spelunker/test/test_toggle.vim b/autoload/spelunker/test/test_toggle.vim index bede0d4..3a4ac03 100644 --- a/autoload/spelunker/test/test_toggle.vim +++ b/autoload/spelunker/test/test_toggle.vim @@ -9,13 +9,14 @@ let s:save_cpo = &cpo set cpo&vim function! spelunker#test#test_toggle#test() - call s:test_toggle() " test global toggle - call s:test_toggle_buffer() " test local toggle call s:test_is_enabled() call s:test_is_enabled_global() call s:test_is_enabled_buffer() - call s:force_enable() + call s:test_toggle() " test global toggle + call s:test_toggle_buffer() " test local toggle + + call s:force_enable_global() endfunction " toggle_mode @@ -31,14 +32,17 @@ function! s:test_toggle() " highlightがなくなっていることを確認 silent! call spelunker#toggle#toggle() + call assert_equal(1, spelunker#toggle#is_enabled()) + let l:result = getmatches() call assert_equal(1, len(l:result)) call assert_equal('SpelunkerSpellBad', l:result[0]['group']) call assert_equal('\v[A-Za-z]@