From a6e4c96c9c11ceecb9c5927224dff783083fa915 Mon Sep 17 00:00:00 2001 From: ryanss Date: Tue, 10 Mar 2015 23:59:00 -0400 Subject: Add test for key remaps --- ftplugin/hackernews.vim | 4 ++-- tests.vader | 21 ++++++++++++++++++++- 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 gx :Python hackernews.link(external=True) noremap u :Python hackernews.save_pos() \u \:Python hackernews.recall_pos() -noremap :Python hackernews.save_pos() - \ +noremap :Python hackernews.save_pos() + \ \:Python hackernews.recall_pos() 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\ -Expect (edit .hackernews): +Expect (HackerNews Defined): HackerNews ? call HackerNews() 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\ + ggVGd + :redir @a\ + :map o\ + :map O\ + :map gx\ + :map u\ + :map \ + "apdd + +Expect (Keys Mapped): + o *@:Python hackernews.link() + O *@:Python hackernews.link(external=True) + gx *@:Python hackernews.link(external=True) + n gx NetrwBrowseX + u *@:Python hackernews.save_pos()u:Python hackernews.recall_pos() + *@:Python hackernews.save_pos():Python hackernews.recall_pos() -- cgit v1.2.3