Skip to content

Commit

Permalink
fix test args order
Browse files Browse the repository at this point in the history
  • Loading branch information
kannokanno committed Jul 26, 2015
1 parent d36c96a commit c3f6055
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions test/autoload/previm_test.vim
Original file line number Diff line number Diff line change
Expand Up @@ -6,63 +6,63 @@ 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()
let arg = ['aaabbb', 'あいうえお漢字']
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()
let arg = ['\(x -> x + 2)', 'あいうえお漢字']
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()
let arg = ['he said. "Hello, john"', 'あいうえお漢字']
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') "{{{

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()
Expand All @@ -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()
Expand Down Expand Up @@ -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()
Expand All @@ -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
"}}}

0 comments on commit c3f6055

Please sign in to comment.