Skip to content
Browse files

Add tests on :Arpeggio command

  • Loading branch information...
1 parent 6fd4081 commit d0539fa6f83b0888d956b9f19391bacbd096ab23 @kana kana committed Apr 20, 2010
Showing with 64 additions and 0 deletions.
  1. +18 −0 test/ui.expected
  2. +46 −0 test/ui.input
View
18 test/ui.expected
@@ -0,0 +1,18 @@
+==== Arpeggio
+---- It should define key mappings properly.
+........x..
+
+
+
+**** Result ****
+
+
+In Arpeggio
+
+It should define key mappings properly.
+FAILED: getline('.') ==# 'rhs1"rhs2'
+ expected: 'rhs1"rhs2'
+ got: 'rhs1'
+
+
+11 examples, 1 failures
View
46 test/ui.input
@@ -0,0 +1,46 @@
+runtime! plugin/arpeggio.vim
+
+function! CheckMapModes(lhs)
+ let _ = ['n', 'x', 's', 'o', 'i', 'c', 'l']
+ call map(_, 'maparg(' . string(a:lhs) . ', v:val)')
+ call map(_, 'v:val != ""')
+ return _
+endfunction
+
+function s:describe__Arpeggio() "{{{1
+ " Set up.
+
+ tabnew
+
+ It should define key mappings properly.
+
+ silent! execute 'Arpeggio inoremap lhs1 rhs1"rhs2'
+ silent! execute 'Arpeggio inoremap lhs2 rhs1<Bar>rhs2'
+ silent! execute 'Arpeggio inoremap lhs3 rhs1|rhs2'
+ Should CheckMapModes('o') ==# [0, 0, 0, 0, 0, 0, 0]
+ Should CheckMapModes('l') ==# [0, 0, 0, 0, 1, 0, 0]
+ Should CheckMapModes('h') ==# [0, 0, 0, 0, 1, 0, 0]
+ Should CheckMapModes('s') ==# [0, 0, 0, 0, 1, 0, 0]
+ Should CheckMapModes('1') ==# [0, 0, 0, 0, 1, 0, 0]
+ Should CheckMapModes('2') ==# [0, 0, 0, 0, 1, 0, 0]
+ Should CheckMapModes('3') ==# [0, 0, 0, 0, 1, 0, 0]
+
+ normal olhs0
+ Should getline('.') ==# 'lhs0'
+ normal olhs1
+ Should getline('.') ==# 'rhs1"rhs2'
+ normal olhs2
+ Should getline('.') ==# 'rhs1|rhs2'
+ normal olhs3
+ Should getline('.') ==# 'rhs1'
+
+ " Tear down.
+
+ tabclose!
+endfunction
+
+
+
+
+" __END__ "{{{1
+" vim: filetype=vim foldmethod=marker

0 comments on commit d0539fa

Please sign in to comment.
Something went wrong with that request. Please try again.