diff --git a/test/autoload/previm_test.vim b/test/autoload/previm_test.vim index cf00b4ca1..01ee13a5e 100644 --- a/test/autoload/previm_test.vim +++ b/test/autoload/previm_test.vim @@ -6,7 +6,7 @@ let s:t = themis#suite('convert_to_content') "{{{ function! s:t.empty_lines() let arg = [] let expected = '' - call s:assert.equals(expected, previm#convert_to_content(arg)) + call s:assert.equals(previm#convert_to_content(arg), expected) endfunction function! s:t.not_exists_escaped() @@ -14,7 +14,7 @@ function! s:t.not_exists_escaped() let expected = \ 'aaabbb' . s:newline \ . 'あいうえお漢字' - call s:assert.equals(expected, previm#convert_to_content(arg)) + call s:assert.equals(previm#convert_to_content(arg), expected) endfunction function! s:t.exists_backslash() @@ -22,7 +22,7 @@ function! s:t.exists_backslash() let expected = \ '\\(x -> x + 2)' . s:newline \ . 'あいうえお漢字' - call s:assert.equals(expected, previm#convert_to_content(arg)) + call s:assert.equals(previm#convert_to_content(arg), expected) endfunction function! s:t.exists_double_quotes() @@ -30,7 +30,7 @@ function! s:t.exists_double_quotes() let expected = \ 'he said. \"Hello, john\"' . s:newline \ . 'あいうえお漢字' - call s:assert.equals(expected, previm#convert_to_content(arg)) + call s:assert.equals(previm#convert_to_content(arg), expected) endfunction "}}} let s:t = themis#suite('relative_to_absolute') "{{{ @@ -38,31 +38,31 @@ let s:t = themis#suite('relative_to_absolute') "{{{ function! s:t.nothing_when_empty() let arg_line = '' let expected = '' - call s:assert.equals(expected, previm#relative_to_absolute_imgpath(arg_line, '')) + call s:assert.equals(previm#relative_to_absolute_imgpath(arg_line, ''), expected) endfunction function! s:t.nothing_when_not_href() let arg_line = 'previm.dummy.com/some/path/img.png' let expected = 'previm.dummy.com/some/path/img.png' - call s:assert.equals(expected, previm#relative_to_absolute_imgpath(arg_line, '')) + call s:assert.equals(previm#relative_to_absolute_imgpath(arg_line, ''), expected) endfunction function! s:t.nothing_when_absolute_by_http() let arg_line = 'http://previm.dummy.com/some/path/img.png' let expected = 'http://previm.dummy.com/some/path/img.png' - call s:assert.equals(expected, previm#relative_to_absolute_imgpath(arg_line, '')) + call s:assert.equals(previm#relative_to_absolute_imgpath(arg_line, ''), expected) endfunction function! s:t.nothing_when_absolute_by_https() let arg_line = 'https://previm.dummy.com/some/path/img.png' let expected = 'https://previm.dummy.com/some/path/img.png' - call s:assert.equals(expected, previm#relative_to_absolute_imgpath(arg_line, '')) + call s:assert.equals(previm#relative_to_absolute_imgpath(arg_line, ''), expected) endfunction function! s:t.nothing_when_absolute_by_file() let arg_line = 'file://previm/some/path/img.png' let expected = 'file://previm/some/path/img.png' - call s:assert.equals(expected, previm#relative_to_absolute_imgpath(arg_line, '')) + call s:assert.equals(previm#relative_to_absolute_imgpath(arg_line, ''), expected) endfunction function! s:t.replace_path_when_relative() @@ -86,19 +86,19 @@ let s:t = themis#suite('fetch_imgpath_elements') "{{{ function! s:t.nothing_when_empty() let arg = '' let expected = s:empty_img_elements() - call s:assert.equals(expected, previm#fetch_imgpath_elements(arg)) + call s:assert.equals(previm#fetch_imgpath_elements(arg), expected) endfunction function! s:t.nothing_when_not_img_statement() let arg = '## hogeほげ' let expected = s:empty_img_elements() - call s:assert.equals(expected, previm#fetch_imgpath_elements(arg)) + call s:assert.equals(previm#fetch_imgpath_elements(arg), expected) endfunction function! s:t.get_title_and_path() let arg = '![IMG](path/img.png)' let expected = {'title': 'IMG', 'path': 'path/img.png'} - call s:assert.equals(expected, previm#fetch_imgpath_elements(arg)) + call s:assert.equals(previm#fetch_imgpath_elements(arg), expected) endfunction function! s:empty_img_elements() @@ -160,7 +160,7 @@ function! s:t.custom_content_if_exists_file() call previm#refresh_css() let actual = readfile(previm#make_preview_file_path('css/previm.css')) - call s:assert.equals(["@import url('user_custom.css');"], actual) + call s:assert.equals(actual, ["@import url('user_custom.css');"]) endfunction function! s:t.empty_if_not_exists_file() @@ -169,6 +169,6 @@ function! s:t.empty_if_not_exists_file() call previm#refresh_css() let actual = readfile(previm#make_preview_file_path('css/previm.css')) - call s:assert.equals([], actual) + call s:assert.equals(actual, []) endfunction "}}}