Permalink
Browse files

Test also positions of '[ and '] for operators

  • Loading branch information...
kana committed Jan 11, 2012
1 parent 1f2c6ff commit 9c9d2b263e8d08ba55edc2deb6f148fafcc36db6
Showing with 251 additions and 57 deletions.
  1. +251 −57 test/basics.input
View
@@ -41,7 +41,7 @@ function! CheckOperations(direction, operation_command)
let last_col = -1
while line('.') == 2 && col('.') != last_col
let last_col = col('.')
- call add(cols, last_col)
+ call add(cols, [last_col, col("'["), col("']")])
silent! execute a:operation_command
endwhile
tabclose!
@@ -167,51 +167,148 @@ function s:describe__UI_key_mappings_with_selection_inclusive() "{{{1
It should move the cursor properly in Operator-pending mode.
Should CheckOperations('forward', 'normal! yw`]') == [
- \ 1, 2, 4, 8, 10,
- \ 14, 17, 20, 21, 24,
- \ 25, 28, 31, 34, 35,
- \ 38, 39, 42, 44, 45
+ \ [1, 0, 0],
+ \ [2, 1, 2],
+ \ [4, 2, 4],
+ \ [8, 4, 8],
+ \ [10, 8, 10],
+ \ [14, 10, 14],
+ \ [17, 14, 17],
+ \ [20, 17, 20],
+ \ [21, 20, 21],
+ \ [24, 21, 24],
+ \ [25, 24, 25],
+ \ [28, 25, 28],
+ \ [31, 28, 31],
+ \ [34, 31, 34],
+ \ [35, 34, 35],
+ \ [38, 35, 38],
+ \ [39, 38, 39],
+ \ [42, 39, 42],
+ \ [44, 42, 44],
+ \ [45, 44, 45],
\ ]
Should CheckOperations('forward', "normal y\<Plug>(smartword-w)`]") == [
- \ 1, 2, 4, 10, 17,
- \ 21, 25, 31, 35, 39,
- \ 44, 45
+ \ [1, 0, 0],
+ \ [2, 1, 2],
+ \ [4, 2, 4],
+ \ [10, 4, 10],
+ \ [17, 10, 17],
+ \ [21, 17, 21],
+ \ [25, 21, 25],
+ \ [31, 25, 31],
+ \ [35, 31, 35],
+ \ [39, 35, 39],
+ \ [44, 39, 44],
+ \ [45, 44, 45],
\ ]
Should CheckOperations('backward', 'normal! yb') == [
- \ 45, 44, 42, 39, 38,
- \ 35, 34, 31, 28, 25,
- \ 24, 21, 20, 17, 14,
- \ 10, 8, 4, 2, 1
+ \ [45, 0, 0],
+ \ [44, 44, 45],
+ \ [42, 42, 44],
+ \ [39, 39, 42],
+ \ [38, 38, 39],
+ \ [35, 35, 38],
+ \ [34, 34, 35],
+ \ [31, 31, 34],
+ \ [28, 28, 31],
+ \ [25, 25, 28],
+ \ [24, 24, 25],
+ \ [21, 21, 24],
+ \ [20, 20, 21],
+ \ [17, 17, 20],
+ \ [14, 14, 17],
+ \ [10, 10, 14],
+ \ [8, 8, 10],
+ \ [4, 4, 8],
+ \ [2, 2, 4],
+ \ [1, 1, 2],
\ ]
Should CheckOperations('backward', "normal y\<Plug>(smartword-b)") == [
- \ 45, 44, 39, 35, 31,
- \ 25, 21, 17, 10, 4,
- \ 2
+ \ [45, 0, 0],
+ \ [44, 44, 45],
+ \ [39, 39, 44],
+ \ [35, 35, 39],
+ \ [31, 31, 35],
+ \ [25, 25, 31],
+ \ [21, 21, 25],
+ \ [17, 17, 21],
+ \ [10, 10, 17],
+ \ [4, 4, 10],
+ \ [2, 2, 4],
\ ]
Should CheckOperations('forward', 'normal! ye`]') == [
- \ 1, 2, 7, 9, 13,
- \ 16, 19, 20, 23, 24,
- \ 27, 30, 33, 34, 37,
- \ 38, 41, 43, 44, 45
+ \ [1, 0, 0],
+ \ [2, 1, 2],
+ \ [7, 2, 7],
+ \ [9, 7, 9],
+ \ [13, 9, 13],
+ \ [16, 13, 16],
+ \ [19, 16, 19],
+ \ [20, 19, 20],
+ \ [23, 20, 23],
+ \ [24, 23, 24],
+ \ [27, 24, 27],
+ \ [30, 27, 30],
+ \ [33, 30, 33],
+ \ [34, 33, 34],
+ \ [37, 34, 37],
+ \ [38, 37, 38],
+ \ [41, 38, 41],
+ \ [43, 41, 43],
+ \ [44, 43, 44],
+ \ [45, 44, 45],
\ ]
Should CheckOperations('forward', "normal y\<Plug>(smartword-e)`]") == [
- \ 1, 2, 7, 13, 19,
- \ 23, 27, 33, 37, 41,
- \ 44
+ \ [1, 0, 0],
+ \ [2, 1, 2],
+ \ [7, 2, 7],
+ \ [13, 7, 13],
+ \ [19, 13, 19],
+ \ [23, 19, 23],
+ \ [27, 23, 27],
+ \ [33, 27, 33],
+ \ [37, 33, 37],
+ \ [41, 37, 41],
+ \ [44, 41, 44],
\ ]
Should CheckOperations('backward', 'normal! yge') == [
- \ 45, 44, 43, 41, 38,
- \ 37, 34, 33, 30, 27,
- \ 24, 23, 20, 19, 16,
- \ 13, 9, 7, 2, 1
+ \ [45, 0, 0],
+ \ [44, 44, 45],
+ \ [43, 43, 44],
+ \ [41, 41, 43],
+ \ [38, 38, 41],
+ \ [37, 37, 38],
+ \ [34, 34, 37],
+ \ [33, 33, 34],
+ \ [30, 30, 33],
+ \ [27, 27, 30],
+ \ [24, 24, 27],
+ \ [23, 23, 24],
+ \ [20, 20, 23],
+ \ [19, 19, 20],
+ \ [16, 16, 19],
+ \ [13, 13, 16],
+ \ [9, 9, 13],
+ \ [7, 7, 9],
+ \ [2, 2, 7],
+ \ [1, 1, 2],
\ ]
Should CheckOperations('backward', "normal y\<Plug>(smartword-ge)") == [
- \ 45, 44, 41, 37, 33,
- \ 27, 23, 19, 13, 7,
- \ 2
+ \ [45, 0, 0],
+ \ [44, 44, 45],
+ \ [41, 41, 44],
+ \ [37, 37, 41],
+ \ [33, 33, 37],
+ \ [27, 27, 33],
+ \ [23, 23, 27],
+ \ [19, 19, 23],
+ \ [13, 13, 19],
+ \ [7, 7, 13],
+ \ [2, 2, 7],
\ ]
set selection&
@@ -326,51 +423,148 @@ function s:describe__UI_key_mappings_with_selection_exclusive() "{{{1
It should move the cursor properly in Operator-pending mode.
Should CheckOperations('forward', 'normal! yw`]') == [
- \ 1, 2, 4, 8, 10,
- \ 14, 17, 20, 21, 24,
- \ 25, 28, 31, 34, 35,
- \ 38, 39, 42, 44, 45
+ \ [1, 0, 0],
+ \ [2, 1, 2],
+ \ [4, 2, 4],
+ \ [8, 4, 8],
+ \ [10, 8, 10],
+ \ [14, 10, 14],
+ \ [17, 14, 17],
+ \ [20, 17, 20],
+ \ [21, 20, 21],
+ \ [24, 21, 24],
+ \ [25, 24, 25],
+ \ [28, 25, 28],
+ \ [31, 28, 31],
+ \ [34, 31, 34],
+ \ [35, 34, 35],
+ \ [38, 35, 38],
+ \ [39, 38, 39],
+ \ [42, 39, 42],
+ \ [44, 42, 44],
+ \ [45, 44, 45],
\ ]
Should CheckOperations('forward', "normal y\<Plug>(smartword-w)`]") == [
- \ 1, 2, 4, 10, 17,
- \ 21, 25, 31, 35, 39,
- \ 44, 45
+ \ [1, 0, 0],
+ \ [2, 1, 2],
+ \ [4, 2, 4],
+ \ [10, 4, 10],
+ \ [17, 10, 17],
+ \ [21, 17, 21],
+ \ [25, 21, 25],
+ \ [31, 25, 31],
+ \ [35, 31, 35],
+ \ [39, 35, 39],
+ \ [44, 39, 44],
+ \ [45, 44, 45],
\ ]
Should CheckOperations('backward', 'normal! yb') == [
- \ 45, 44, 42, 39, 38,
- \ 35, 34, 31, 28, 25,
- \ 24, 21, 20, 17, 14,
- \ 10, 8, 4, 2, 1
+ \ [45, 0, 0],
+ \ [44, 44, 45],
+ \ [42, 42, 44],
+ \ [39, 39, 42],
+ \ [38, 38, 39],
+ \ [35, 35, 38],
+ \ [34, 34, 35],
+ \ [31, 31, 34],
+ \ [28, 28, 31],
+ \ [25, 25, 28],
+ \ [24, 24, 25],
+ \ [21, 21, 24],
+ \ [20, 20, 21],
+ \ [17, 17, 20],
+ \ [14, 14, 17],
+ \ [10, 10, 14],
+ \ [8, 8, 10],
+ \ [4, 4, 8],
+ \ [2, 2, 4],
+ \ [1, 1, 2],
\ ]
Should CheckOperations('backward', "normal y\<Plug>(smartword-b)") == [
- \ 45, 44, 39, 35, 31,
- \ 25, 21, 17, 10, 4,
- \ 2
+ \ [45, 0, 0],
+ \ [44, 44, 45],
+ \ [39, 39, 44],
+ \ [35, 35, 39],
+ \ [31, 31, 35],
+ \ [25, 25, 31],
+ \ [21, 21, 25],
+ \ [17, 17, 21],
+ \ [10, 10, 17],
+ \ [4, 4, 10],
+ \ [2, 2, 4],
\ ]
Should CheckOperations('forward', 'normal! ye`]') == [
- \ 1, 2, 7, 9, 13,
- \ 16, 19, 20, 23, 24,
- \ 27, 30, 33, 34, 37,
- \ 38, 41, 43, 44, 45
+ \ [1, 0, 0],
+ \ [2, 1, 2],
+ \ [7, 2, 7],
+ \ [9, 7, 9],
+ \ [13, 9, 13],
+ \ [16, 13, 16],
+ \ [19, 16, 19],
+ \ [20, 19, 20],
+ \ [23, 20, 23],
+ \ [24, 23, 24],
+ \ [27, 24, 27],
+ \ [30, 27, 30],
+ \ [33, 30, 33],
+ \ [34, 33, 34],
+ \ [37, 34, 37],
+ \ [38, 37, 38],
+ \ [41, 38, 41],
+ \ [43, 41, 43],
+ \ [44, 43, 44],
+ \ [45, 44, 45],
\ ]
Should CheckOperations('forward', "normal y\<Plug>(smartword-e)`]") == [
- \ 1, 2, 7, 13, 19,
- \ 23, 27, 33, 37, 41,
- \ 44
+ \ [1, 0, 0],
+ \ [2, 1, 2],
+ \ [7, 2, 7],
+ \ [13, 7, 13],
+ \ [19, 13, 19],
+ \ [23, 19, 23],
+ \ [27, 23, 27],
+ \ [33, 27, 33],
+ \ [37, 33, 37],
+ \ [41, 37, 41],
+ \ [44, 41, 44],
\ ]
Should CheckOperations('backward', 'normal! yge') == [
- \ 45, 44, 43, 41, 38,
- \ 37, 34, 33, 30, 27,
- \ 24, 23, 20, 19, 16,
- \ 13, 9, 7, 2, 1
+ \ [45, 0, 0],
+ \ [44, 44, 45],
+ \ [43, 43, 44],
+ \ [41, 41, 43],
+ \ [38, 38, 41],
+ \ [37, 37, 38],
+ \ [34, 34, 37],
+ \ [33, 33, 34],
+ \ [30, 30, 33],
+ \ [27, 27, 30],
+ \ [24, 24, 27],
+ \ [23, 23, 24],
+ \ [20, 20, 23],
+ \ [19, 19, 20],
+ \ [16, 16, 19],
+ \ [13, 13, 16],
+ \ [9, 9, 13],
+ \ [7, 7, 9],
+ \ [2, 2, 7],
+ \ [1, 1, 2],
\ ]
Should CheckOperations('backward', "normal y\<Plug>(smartword-ge)") == [
- \ 45, 44, 41, 37, 33,
- \ 27, 23, 19, 13, 7,
- \ 2
+ \ [45, 0, 0],
+ \ [44, 44, 44],
+ \ [41, 41, 43],
+ \ [37, 37, 40],
+ \ [33, 33, 36],
+ \ [27, 27, 32],
+ \ [23, 23, 26],
+ \ [19, 19, 22],
+ \ [13, 13, 18],
+ \ [7, 7, 12],
+ \ [2, 2, 6],
\ ]
set selection&

0 comments on commit 9c9d2b2

Please sign in to comment.