summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorryanss2015-03-10 23:59:00 -0400
committerryanss2015-03-10 23:59:00 -0400
commita6e4c96c9c11ceecb9c5927224dff783083fa915 (patch)
treed946320c45af16d95078db313b5445d7dd416d74
parentcc91b9b380d7992ac2fa01e49a63bfffc2c2fd64 (diff)
downloadvim-hn-a6e4c96c9c11ceecb9c5927224dff783083fa915.tar.gz
Add test for key remaps
-rw-r--r--ftplugin/hackernews.vim4
-rw-r--r--tests.vader21
2 files changed, 22 insertions, 3 deletions
diff --git a/ftplugin/hackernews.vim b/ftplugin/hackernews.vim
index 5f42f7c..f8447f7 100644
--- a/ftplugin/hackernews.vim
+++ b/ftplugin/hackernews.vim
@@ -45,8 +45,8 @@ noremap <buffer> gx :Python hackernews.link(external=True)<cr>
noremap <buffer> u :Python hackernews.save_pos()<cr>
\u
\:Python hackernews.recall_pos()<cr>
-noremap <buffer> <C-r> :Python hackernews.save_pos()<cr>
- \<C-r>
+noremap <buffer> <C-R> :Python hackernews.save_pos()<cr>
+ \<C-R>
\:Python hackernews.recall_pos()<cr>
diff --git a/tests.vader b/tests.vader
index 2638593..e2d9198 100644
--- a/tests.vader
+++ b/tests.vader
@@ -43,7 +43,7 @@ Do (Test HackerNews Defined):
"cpdddd
:%s/ \{2,}/ /g\<cr>
-Expect (edit .hackernews):
+Expect (HackerNews Defined):
HackerNews ? call HackerNews(<q-args>)
Execute (Test HackerNews Command):
@@ -56,3 +56,22 @@ Then (Test Front Page):
AssertEqual 'Comment', SyntaxAt(5,2), 'Item number syntax'
AssertEqual 'Comment', SyntaxAt(6,5), 'Point/user/comment line syntax'
AssertEqual '', SyntaxAt(5,5), 'Item title syntax'
+
+Do (Test Key Mappings):
+ :HackerNews\<cr>
+ ggVGd
+ :redir @a\<cr>
+ :map o\<cr>
+ :map O\<cr>
+ :map gx\<cr>
+ :map u\<cr>
+ :map <C-R>\<cr>
+ "apdd
+
+Expect (Keys Mapped):
+ o *@:Python hackernews.link()<CR>
+ O *@:Python hackernews.link(external=True)<CR>
+ gx *@:Python hackernews.link(external=True)<CR>
+ n gx <Plug>NetrwBrowseX
+ u *@:Python hackernews.save_pos()<CR>u:Python hackernews.recall_pos()<CR>
+ <C-R> *@:Python hackernews.save_pos()<CR><C-R>:Python hackernews.recall_pos()<CR>