Navigation Menu

Skip to content

Commit

Permalink
Add some initial tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jaxbot committed Sep 3, 2014
1 parent 486f6b4 commit 79be509
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions test/test.vim
@@ -0,0 +1,47 @@
function! s:run_tests()
exec ":Gissues"
let line = getline(".")

call s:expectEqual(getline("."), "No results found in jaxbot/test")

exec ":Giadd"

call s:expectEqual(getline("."), "# (new)")

exec "normal iTest Issue for Gissues"
exec ":w"

call s:expectEqual(getline("7"), "No comments.")

exec ":4"
normal $a enhancement
normal GoTest comment

exec ":w"
call s:expectEqual(getline("8"), "Test comment")
call s:expectEqual(getline("4"), "## Labels: enhancement")

exec ":Gissues"
normal ee
call s:expectEqual(expand("<cword>"), "Test")

exec "normal \<cr>"

call s:expectEqual(getline("3"), "## State: open")
normal cc
call s:expectEqual(getline("3"), "## State: closed")

echom "Finished!"
exec ":messages"
endfunction

function! s:expectEqual(actual, expected)
if a:actual == a:expected
else
throw "Assertion failed: Expected " . a:expected . ", got " . a:actual
endif
endfunction

edit ~/www/test/README.md
call s:run_tests()

0 comments on commit 79be509

Please sign in to comment.