Skip to content
Browse files

Quick-fix to use vspec

  • Loading branch information...
1 parent 0b0c823 commit c4d42b9dfbf159d84b41fa907f377deb0271064b @kana committed Apr 1, 2010
Showing with 207 additions and 323 deletions.
  1. +4 −0 Makefile
  2. +36 −160 test/basic.expected
  3. +167 −163 test/basic.input
View
4 Makefile
@@ -5,6 +5,10 @@ INSTALLATION_DIR := $(HOME)/.vim
TARGETS_STATIC = $(filter %.vim %.txt,$(all_files_in_repos))
TARGETS_ARCHIVED = $(all_files_in_repos) mduem/Makefile
+DEPS := vim-operator-user
+DEP_vim_operator_user_URI := ../vim-operator-user
+DEP_vim_operator_user_VERSION := 0.0.5
+
View
196 test/basic.expected
@@ -1,170 +1,46 @@
-===== "Named key mappings"
-TEST: maparg(_, 'c') != '' ==> 0 ... ok
-TEST: maparg(_, 'i') != '' ==> 0 ... ok
-TEST: maparg(_, 'n') != '' ==> 1 ... ok
-TEST: maparg(_, 'o') != '' ==> 1 ... ok
-TEST: maparg(_, 'v') != '' ==> 1 ... ok
-TEST: maparg(_, 'n') =~# 'operator#replace#' ==> 1 ... ok
-TEST: maparg(_, 'o') ==> 'g@' ... ok
-TEST: maparg(_, 'v') =~# 'operator#replace#' ==> 1 ... ok
-Result: 8 / 8
+==== named_key_mappings
+---- It "Named key mappings"
+........
-===== "Usage: block {motion} vs block {register} content"
-TEST: getline(1, line('$')) ==> text ... ok
-Result: 1 / 1
+==== usage_block_vs_block
+---- It "Usage: block {motion} vs block {register} content"
+.
-===== "Usage: block {motion} vs char {register} content"
-TEST: getline(1, line('$')) ==> text ... ok
-Result: 1 / 1
+==== usage_block_vs_char
+---- It "Usage: block {motion} vs char {register} content"
+.
-===== "Usage: block {motion} vs line {register} content"
-TEST: getline(1, line('$')) ==> text ... ok
-Result: 1 / 1
+==== usage_block_vs_line
+---- It "Usage: block {motion} vs line {register} content"
+.
-===== "Usage: char {motion} vs block {register} content"
-TEST: getline(1, line('$')) ==> text ... ok
-Result: 1 / 1
+==== usage_char_vs_block
+---- It "Usage: char {motion} vs block {register} content"
+.
-===== "Usage: char {motion} vs char {register} content"
-TEST: getline(1, line('$')) ==> text ... ok
-TEST: [line('.'), col('.')] ==> [1, 7] ... ok
-TEST: [getreg('"'), getregtype('"')] ==> ['unnamed', 'v'] ... ok
-TEST: getline(1) ==> '(herb unnamed pepper) salt water' ... ok
-TEST: getline(2) ==> 'Super Super Mega Kawaii' ... ok
-TEST: getline(3) ==> 'Sasara moe! It''s burning!' ... ok
-TEST: getline(4) ==> 'Alter, you are also SSMK.' ... ok
-TEST: getline(5) ==> 'I"m-happy.' ... ok
-TEST: getline(6) ==> 'You"re-happy.' ... ok
-TEST: [getreg('"'), getregtype('"')] ==> ['unnamed', 'v'] ... ok
-TEST: [line('.'), col('.')] ==> [2, 8] ... ok
-TEST: [getreg('"'), getregtype('"')] ==> ['unnamed2', 'v'] ... ok
-TEST: getline(1) ==> '(herb unnamed pepper) salt water' ... ok
-TEST: getline(2) ==> 'Super Sunnamed2ga Kawaii' ... ok
-TEST: getline(3) ==> 'Sasara moe! It''s burning!' ... ok
-TEST: getline(4) ==> 'Alter, you are also SSMK.' ... ok
-TEST: getline(5) ==> 'I"m-happy.' ... ok
-TEST: getline(6) ==> 'You"re-happy.' ... ok
-TEST: [getreg('"'), getregtype('"')] ==> ['unnamed2', 'v'] ... ok
-TEST: [line('.'), col('.')] ==> [3, 8] ... ok
-TEST: [getreg('"'), getregtype('"')] ==> ['unnamed3', 'v'] ... ok
-TEST: [getreg('s'), getregtype('s')] ==> ['!@#$%^&*()', 'v'] ... ok
-TEST: getline(1) ==> '(herb unnamed pepper) salt water' ... ok
-TEST: getline(2) ==> 'Super Sunnamed2ga Kawaii' ... ok
-TEST: getline(3) ==> 'Sasara !@#$%^&*()! It''s burning!' ... ok
-TEST: getline(4) ==> 'Alter, you are also SSMK.' ... ok
-TEST: getline(5) ==> 'I"m-happy.' ... ok
-TEST: getline(6) ==> 'You"re-happy.' ... ok
-TEST: [getreg('"'), getregtype('"')] ==> ['unnamed3', 'v'] ... ok
-TEST: [getreg('s'), getregtype('s')] ==> ['!@#$%^&*()', 'v'] ... ok
-TEST: [line('.'), col('.')] ==> [4, 16] ... ok
-TEST: [getreg('s'), getregtype('s')] ==> [')(*&^%$#@!', 'v'] ... ok
-TEST: [getreg('"'), getregtype('"')] ==> ['unnamed4', 'v'] ... ok
-TEST: getline(1) ==> '(herb unnamed pepper) salt water' ... ok
-TEST: getline(2) ==> 'Super Sunnamed2ga Kawaii' ... ok
-TEST: getline(3) ==> 'Sasara !@#$%^&*()! It''s burning!' ... ok
-TEST: getline(4) ==> 'Alter, you are )(*&^%$#@! SSMK.' ... ok
-TEST: getline(5) ==> 'I"m-happy.' ... ok
-TEST: getline(6) ==> 'You"re-happy.' ... ok
-TEST: [getreg('"'), getregtype('"')] ==> ['unnamed4', 'v'] ... ok
-TEST: [getreg('s'), getregtype('s')] ==> [')(*&^%$#@!', 'v'] ... ok
-TEST: [line('.'), col('.')] ==> [5, 5] ... ok
-TEST: [getreg('s'), getregtype('s')] ==> ['amane', 'v'] ... ok
-TEST: [getreg('"'), getregtype('"')] ==> ['unnamed4', 'v'] ... ok
-TEST: getline(1) ==> '(herb unnamed pepper) salt water' ... ok
-TEST: getline(2) ==> 'Super Sunnamed2ga Kawaii' ... ok
-TEST: getline(3) ==> 'Sasara !@#$%^&*()! It''s burning!' ... ok
-TEST: getline(4) ==> 'Alter, you are )(*&^%$#@! SSMK.' ... ok
-TEST: getline(5) ==> 'I"m-amane' ... ok
-TEST: getline(6) ==> 'You"re-happy.' ... ok
-TEST: [getreg('"'), getregtype('"')] ==> ['unnamed4', 'v'] ... ok
-TEST: [getreg('s'), getregtype('s')] ==> ['amane', 'v'] ... ok
-TEST: [line('.'), col('.')] ==> [6, 8] ... ok
-TEST: [getreg('s'), getregtype('s')] ==> ['avril', 'v'] ... ok
-TEST: [getreg('"'), getregtype('"')] ==> ['unnamed4', 'v'] ... ok
-TEST: getline(1) ==> '(herb unnamed pepper) salt water' ... ok
-TEST: getline(2) ==> 'Super Sunnamed2ga Kawaii' ... ok
-TEST: getline(3) ==> 'Sasara !@#$%^&*()! It''s burning!' ... ok
-TEST: getline(4) ==> 'Alter, you are )(*&^%$#@! SSMK.' ... ok
-TEST: getline(5) ==> 'I"m-amane' ... ok
-TEST: getline(6) ==> 'You"re-avril' ... ok
-TEST: [getreg('"'), getregtype('"')] ==> ['unnamed4', 'v'] ... ok
-TEST: [getreg('s'), getregtype('s')] ==> ['avril', 'v'] ... ok
-Result: 63 / 63
+==== usage_char_vs_char
+---- It "Usage: char {motion} vs char {register} content"
+...............................................................
-===== "Usage: char {motion} vs line {register} content"
-TEST: getline(1, line('$')) ==> text ... ok
-Result: 1 / 1
+==== usage_char_vs_line
+---- It "Usage: char {motion} vs line {register} content"
+.
-===== "Usage: line {motion} vs block {register} content"
-TEST: getline(1, line('$')) ==> text ... ok
-Result: 1 / 1
+==== usage_line_vs_block
+---- It "Usage: line {motion} vs block {register} content"
+.
-===== "Usage: line {motion} vs char {register} content"
-TEST: getline(1, line('$')) ==> text ... ok
-Result: 1 / 1
+==== usage_line_vs_char
+---- It "Usage: line {motion} vs char {register} content"
+.
-===== "Usage: line {motion} vs line {register} content"
-TEST: getline(1, line('$')) ==> text ... ok
-TEST: [getreg('"'), getregtype('"')] ==> ["unnamed1\n", 'V'] ... ok
-TEST: [getreg('s'), getregtype('s')] ==> ["Spiral1\n", 'V'] ... ok
-TEST: getline(1) ==> 'unnamed1' ... ok
-TEST: getline(2) ==> 'Super Super Mega Kawaii' ... ok
-TEST: getline(3) ==> 'Sasara moe! It''s burning!' ... ok
-TEST: getline(4) ==> 'Alter, you are also SSMK.' ... ok
-TEST: getline(5) ==> 'I"m-happy.' ... ok
-TEST: getline(6) ==> 'You"re-happy.' ... ok
-TEST: [getreg('"'), getregtype('"')] ==> ["unnamed1\n", 'V'] ... ok
-TEST: [getreg('s'), getregtype('s')] ==> ["Spiral1\n", 'V'] ... ok
-TEST: [getreg('"'), getregtype('"')] ==> ["unnamed2\n", 'V'] ... ok
-TEST: [getreg('"'), getregtype('"')] ==> ["unnamed2\n", 'V'] ... ok
-TEST: getline(1) ==> 'unnamed1' ... ok
-TEST: getline(2) ==> 'unnamed2' ... ok
-TEST: getline(3) ==> 'Sasara moe! It''s burning!' ... ok
-TEST: getline(4) ==> 'Alter, you are also SSMK.' ... ok
-TEST: getline(5) ==> 'I"m-happy.' ... ok
-TEST: getline(6) ==> 'You"re-happy.' ... ok
-TEST: [getreg('"'), getregtype('"')] ==> ["unnamed2\n", 'V'] ... ok
-TEST: [getreg('s'), getregtype('s')] ==> ["Spiral2\n", 'V'] ... ok
-TEST: [getreg('"'), getregtype('"')] ==> ["unnamed3\n", 'V'] ... ok
-TEST: [getreg('s'), getregtype('s')] ==> ["Spiral3\n", 'V'] ... ok
-TEST: getline(1) ==> 'unnamed1' ... ok
-TEST: getline(2) ==> 'unnamed2' ... ok
-TEST: getline(3) ==> 'Spiral3' ... ok
-TEST: getline(4) ==> 'Alter, you are also SSMK.' ... ok
-TEST: getline(5) ==> 'I"m-happy.' ... ok
-TEST: getline(6) ==> 'You"re-happy.' ... ok
-TEST: [getreg('"'), getregtype('"')] ==> ["unnamed3\n", 'V'] ... ok
-TEST: [getreg('s'), getregtype('s')] ==> ["Spiral3\n", 'V'] ... ok
-TEST: [getreg('"'), getregtype('"')] ==> ["unnamed4\n", 'V'] ... ok
-TEST: [getreg('s'), getregtype('s')] ==> ["Spiral4\n", 'V'] ... ok
-TEST: getline(1) ==> 'unnamed1' ... ok
-TEST: getline(2) ==> 'unnamed2' ... ok
-TEST: getline(3) ==> 'Spiral3' ... ok
-TEST: getline(4) ==> 'Spiral4' ... ok
-TEST: getline(5) ==> 'I"m-happy.' ... ok
-TEST: getline(6) ==> 'You"re-happy.' ... ok
-TEST: [getreg('"'), getregtype('"')] ==> ["unnamed4\n", 'V'] ... ok
-TEST: [getreg('s'), getregtype('s')] ==> ["Spiral4\n", 'V'] ... ok
-TEST: [getreg('"'), getregtype('"')] ==> ["unnamed5\n", 'V'] ... ok
-TEST: [getreg('s'), getregtype('s')] ==> ["Spiral5\n", 'V'] ... ok
-TEST: getline(1) ==> 'unnamed1' ... ok
-TEST: getline(2) ==> 'unnamed2' ... ok
-TEST: getline(3) ==> 'Spiral3' ... ok
-TEST: getline(4) ==> 'Spiral4' ... ok
-TEST: getline(5) ==> 'unnamed5' ... ok
-TEST: line('$') ==> 5 ... ok
-TEST: [getreg('"'), getregtype('"')] ==> ["unnamed5\n", 'V'] ... ok
-TEST: [getreg('s'), getregtype('s')] ==> ["Spiral5\n", 'V'] ... ok
-TEST: [getreg('"'), getregtype('"')] ==> ["unnamed6\n", 'V'] ... ok
-TEST: [getreg('s'), getregtype('s')] ==> ["Spiral6\n", 'V'] ... ok
-TEST: getline(1) ==> 'unnamed1' ... ok
-TEST: getline(2) ==> 'unnamed2' ... ok
-TEST: getline(3) ==> 'Spiral3' ... ok
-TEST: getline(4) ==> 'unnamed6' ... ok
-TEST: line('$') ==> 4 ... ok
-TEST: [getreg('"'), getregtype('"')] ==> ["unnamed6\n", 'V'] ... ok
-TEST: [getreg('s'), getregtype('s')] ==> ["Spiral6\n", 'V'] ... ok
-Result: 60 / 60
+==== usage_line_vs_line
+---- It "Usage: line {motion} vs line {register} content"
+............................................................
-===== Total
-Result: 138 / 138
+
+
+**** Result ****
+
+
+138 examples, 0 failures
View
330 test/basic.input
@@ -1,24 +1,30 @@
-" Tests for operator-replace
-function s:test_named_key_mappings() "{{{1
- Title "Named key mappings"
+" Common set up "{{{1
+
+runtime! plugin/operator/*.vim
+
+
+
+
+function s:describe__named_key_mappings() "{{{1
+ It "Named key mappings"
let _ = '<Plug>(operator-replace)'
- Assert maparg(_, 'c') != '' ==> 0
- Assert maparg(_, 'i') != '' ==> 0
- Assert maparg(_, 'n') != '' ==> 1
- Assert maparg(_, 'o') != '' ==> 1
- Assert maparg(_, 'v') != '' ==> 1
-
- Assert maparg(_, 'n') =~# 'operator#replace#' ==> 1
- Assert maparg(_, 'o') ==> 'g@'
- Assert maparg(_, 'v') =~# 'operator#replace#' ==> 1
+ Should maparg(_, 'c') != '' ==# 0
+ Should maparg(_, 'i') != '' ==# 0
+ Should maparg(_, 'n') != '' ==# 1
+ Should maparg(_, 'o') != '' ==# 1
+ Should maparg(_, 'v') != '' ==# 1
+
+ Should maparg(_, 'n') =~# 'operator#replace#'
+ Should maparg(_, 'o') ==# 'g@'
+ Should maparg(_, 'v') =~# 'operator#replace#'
endfunction
-function s:test_usage_block_vs_block() "{{{1
- Title "Usage: block {motion} vs block {register} content"
+function s:describe__usage_block_vs_block() "{{{1
+ It "Usage: block {motion} vs block {register} content"
tabnew
tabonly!
@@ -30,16 +36,16 @@ function s:test_usage_block_vs_block() "{{{1
\ ]
silent put =text
1 delete _
- Assert getline(1, line('$')) ==> text
+ Should getline(1, line('$')) ==# text
" FIXME: NIY - but what result I expect for this case?
endfunction
-function s:test_usage_block_vs_char() "{{{1
- Title "Usage: block {motion} vs char {register} content"
+function s:describe__usage_block_vs_char() "{{{1
+ It "Usage: block {motion} vs char {register} content"
tabnew
tabonly!
@@ -51,16 +57,16 @@ function s:test_usage_block_vs_char() "{{{1
\ ]
silent put =text
1 delete _
- Assert getline(1, line('$')) ==> text
+ Should getline(1, line('$')) ==# text
" FIXME: NIY - but what result I expect for this case?
endfunction
-function s:test_usage_block_vs_line() "{{{1
- Title "Usage: block {motion} vs line {register} content"
+function s:describe__usage_block_vs_line() "{{{1
+ It "Usage: block {motion} vs line {register} content"
tabnew
tabonly!
@@ -72,16 +78,16 @@ function s:test_usage_block_vs_line() "{{{1
\ ]
silent put =text
1 delete _
- Assert getline(1, line('$')) ==> text
+ Should getline(1, line('$')) ==# text
" FIXME: NIY - but what result I expect for this case?
endfunction
-function s:test_usage_char_vs_block() "{{{1
- Title "Usage: char {motion} vs block {register} content"
+function s:describe__usage_char_vs_block() "{{{1
+ It "Usage: char {motion} vs block {register} content"
tabnew
tabonly!
@@ -93,16 +99,16 @@ function s:test_usage_char_vs_block() "{{{1
\ ]
silent put =text
1 delete _
- Assert getline(1, line('$')) ==> text
+ Should getline(1, line('$')) ==# text
" FIXME: NIY - but what result I expect for this case?
endfunction
-function s:test_usage_char_vs_char() "{{{1
- Title "Usage: char {motion} vs char {register} content"
+function s:describe__usage_char_vs_char() "{{{1
+ It "Usage: char {motion} vs char {register} content"
tabnew
tabonly!
@@ -117,110 +123,110 @@ function s:test_usage_char_vs_char() "{{{1
\ ]
silent put =text
1 delete _
- Assert getline(1, line('$')) ==> text
+ Should getline(1, line('$')) ==# text
" Case 1: {operator}{characterwise-motion} without register designation
normal! 1G0W
- Assert [line('.'), col('.')] ==> [1, 7]
+ Should [line('.'), col('.')] ==# [1, 7]
let @" = 'unnamed'
- Assert [getreg('"'), getregtype('"')] ==> ['unnamed', 'v']
+ Should [getreg('"'), getregtype('"')] ==# ['unnamed', 'v']
execute 'normal' "\<Plug>(operator-replace)e"
- Assert getline(1) ==> '(herb unnamed pepper) salt water'
- Assert getline(2) ==> 'Super Super Mega Kawaii'
- Assert getline(3) ==> 'Sasara moe! It''s burning!'
- Assert getline(4) ==> 'Alter, you are also SSMK.'
- Assert getline(5) ==> 'I"m-happy.'
- Assert getline(6) ==> 'You"re-happy.'
- Assert [getreg('"'), getregtype('"')] ==> ['unnamed', 'v']
+ Should getline(1) ==# '(herb unnamed pepper) salt water'
+ Should getline(2) ==# 'Super Super Mega Kawaii'
+ Should getline(3) ==# 'Sasara moe! It''s burning!'
+ Should getline(4) ==# 'Alter, you are also SSMK.'
+ Should getline(5) ==# 'I"m-happy.'
+ Should getline(6) ==# 'You"re-happy.'
+ Should [getreg('"'), getregtype('"')] ==# ['unnamed', 'v']
" Case 2: {characterwise-Visual}{operator} without register designation
normal! 2G0Wl
- Assert [line('.'), col('.')] ==> [2, 8]
+ Should [line('.'), col('.')] ==# [2, 8]
let @" = 'unnamed2'
- Assert [getreg('"'), getregtype('"')] ==> ['unnamed2', 'v']
+ Should [getreg('"'), getregtype('"')] ==# ['unnamed2', 'v']
execute 'normal' "vWl\<Plug>(operator-replace)"
- Assert getline(1) ==> '(herb unnamed pepper) salt water'
- Assert getline(2) ==> 'Super Sunnamed2ga Kawaii'
- Assert getline(3) ==> 'Sasara moe! It''s burning!'
- Assert getline(4) ==> 'Alter, you are also SSMK.'
- Assert getline(5) ==> 'I"m-happy.'
- Assert getline(6) ==> 'You"re-happy.'
- Assert [getreg('"'), getregtype('"')] ==> ['unnamed2', 'v']
+ Should getline(1) ==# '(herb unnamed pepper) salt water'
+ Should getline(2) ==# 'Super Sunnamed2ga Kawaii'
+ Should getline(3) ==# 'Sasara moe! It''s burning!'
+ Should getline(4) ==# 'Alter, you are also SSMK.'
+ Should getline(5) ==# 'I"m-happy.'
+ Should getline(6) ==# 'You"re-happy.'
+ Should [getreg('"'), getregtype('"')] ==# ['unnamed2', 'v']
" Case 3: {operator}{characterwise-motion} with register designation
normal! 3G0W
- Assert [line('.'), col('.')] ==> [3, 8]
+ Should [line('.'), col('.')] ==# [3, 8]
let @" = 'unnamed3'
let @s = '!@#$%^&*()'
- Assert [getreg('"'), getregtype('"')] ==> ['unnamed3', 'v']
- Assert [getreg('s'), getregtype('s')] ==> ['!@#$%^&*()', 'v']
+ Should [getreg('"'), getregtype('"')] ==# ['unnamed3', 'v']
+ Should [getreg('s'), getregtype('s')] ==# ['!@#$%^&*()', 'v']
execute 'normal' "\"s\<Plug>(operator-replace)e"
- Assert getline(1) ==> '(herb unnamed pepper) salt water'
- Assert getline(2) ==> 'Super Sunnamed2ga Kawaii'
- Assert getline(3) ==> 'Sasara !@#$%^&*()! It''s burning!'
- Assert getline(4) ==> 'Alter, you are also SSMK.'
- Assert getline(5) ==> 'I"m-happy.'
- Assert getline(6) ==> 'You"re-happy.'
- Assert [getreg('"'), getregtype('"')] ==> ['unnamed3', 'v']
- Assert [getreg('s'), getregtype('s')] ==> ['!@#$%^&*()', 'v']
+ Should getline(1) ==# '(herb unnamed pepper) salt water'
+ Should getline(2) ==# 'Super Sunnamed2ga Kawaii'
+ Should getline(3) ==# 'Sasara !@#$%^&*()! It''s burning!'
+ Should getline(4) ==# 'Alter, you are also SSMK.'
+ Should getline(5) ==# 'I"m-happy.'
+ Should getline(6) ==# 'You"re-happy.'
+ Should [getreg('"'), getregtype('"')] ==# ['unnamed3', 'v']
+ Should [getreg('s'), getregtype('s')] ==# ['!@#$%^&*()', 'v']
" Case 4: {characterwise-Visual}{operator} with register designation
normal! 4G$BB
- Assert [line('.'), col('.')] ==> [4, 16]
+ Should [line('.'), col('.')] ==# [4, 16]
let @" = 'unnamed4'
let @s = ')(*&^%$#@!'
- Assert [getreg('s'), getregtype('s')] ==> [')(*&^%$#@!', 'v']
- Assert [getreg('"'), getregtype('"')] ==> ['unnamed4', 'v']
+ Should [getreg('s'), getregtype('s')] ==# [')(*&^%$#@!', 'v']
+ Should [getreg('"'), getregtype('"')] ==# ['unnamed4', 'v']
execute 'normal' "ve\"s\<Plug>(operator-replace)"
- Assert getline(1) ==> '(herb unnamed pepper) salt water'
- Assert getline(2) ==> 'Super Sunnamed2ga Kawaii'
- Assert getline(3) ==> 'Sasara !@#$%^&*()! It''s burning!'
- Assert getline(4) ==> 'Alter, you are )(*&^%$#@! SSMK.'
- Assert getline(5) ==> 'I"m-happy.'
- Assert getline(6) ==> 'You"re-happy.'
- Assert [getreg('"'), getregtype('"')] ==> ['unnamed4', 'v']
- Assert [getreg('s'), getregtype('s')] ==> [')(*&^%$#@!', 'v']
+ Should getline(1) ==# '(herb unnamed pepper) salt water'
+ Should getline(2) ==# 'Super Sunnamed2ga Kawaii'
+ Should getline(3) ==# 'Sasara !@#$%^&*()! It''s burning!'
+ Should getline(4) ==# 'Alter, you are )(*&^%$#@! SSMK.'
+ Should getline(5) ==# 'I"m-happy.'
+ Should getline(6) ==# 'You"re-happy.'
+ Should [getreg('"'), getregtype('"')] ==# ['unnamed4', 'v']
+ Should [getreg('s'), getregtype('s')] ==# [')(*&^%$#@!', 'v']
" Case 5: {operator}{characterwise-motion} including the end of buffer
normal! 5G$b
- Assert [line('.'), col('.')] ==> [5, 5]
+ Should [line('.'), col('.')] ==# [5, 5]
let @" = 'unnamed4'
let @s = 'amane'
- Assert [getreg('s'), getregtype('s')] ==> ['amane', 'v']
- Assert [getreg('"'), getregtype('"')] ==> ['unnamed4', 'v']
+ Should [getreg('s'), getregtype('s')] ==# ['amane', 'v']
+ Should [getreg('"'), getregtype('"')] ==# ['unnamed4', 'v']
execute 'normal' "\"s\<Plug>(operator-replace)$"
- Assert getline(1) ==> '(herb unnamed pepper) salt water'
- Assert getline(2) ==> 'Super Sunnamed2ga Kawaii'
- Assert getline(3) ==> 'Sasara !@#$%^&*()! It''s burning!'
- Assert getline(4) ==> 'Alter, you are )(*&^%$#@! SSMK.'
- Assert getline(5) ==> 'I"m-amane'
- Assert getline(6) ==> 'You"re-happy.'
- Assert [getreg('"'), getregtype('"')] ==> ['unnamed4', 'v']
- Assert [getreg('s'), getregtype('s')] ==> ['amane', 'v']
+ Should getline(1) ==# '(herb unnamed pepper) salt water'
+ Should getline(2) ==# 'Super Sunnamed2ga Kawaii'
+ Should getline(3) ==# 'Sasara !@#$%^&*()! It''s burning!'
+ Should getline(4) ==# 'Alter, you are )(*&^%$#@! SSMK.'
+ Should getline(5) ==# 'I"m-amane'
+ Should getline(6) ==# 'You"re-happy.'
+ Should [getreg('"'), getregtype('"')] ==# ['unnamed4', 'v']
+ Should [getreg('s'), getregtype('s')] ==# ['amane', 'v']
" Case 6: {characterwise-Visual}{operator} including the end of buffer
normal! 6G$b
- Assert [line('.'), col('.')] ==> [6, 8]
+ Should [line('.'), col('.')] ==# [6, 8]
let @" = 'unnamed4'
let @s = 'avril'
- Assert [getreg('s'), getregtype('s')] ==> ['avril', 'v']
- Assert [getreg('"'), getregtype('"')] ==> ['unnamed4', 'v']
+ Should [getreg('s'), getregtype('s')] ==# ['avril', 'v']
+ Should [getreg('"'), getregtype('"')] ==# ['unnamed4', 'v']
execute 'normal' "v$\"s\<Plug>(operator-replace)"
- Assert getline(1) ==> '(herb unnamed pepper) salt water'
- Assert getline(2) ==> 'Super Sunnamed2ga Kawaii'
- Assert getline(3) ==> 'Sasara !@#$%^&*()! It''s burning!'
- Assert getline(4) ==> 'Alter, you are )(*&^%$#@! SSMK.'
- Assert getline(5) ==> 'I"m-amane'
- Assert getline(6) ==> 'You"re-avril'
- Assert [getreg('"'), getregtype('"')] ==> ['unnamed4', 'v']
- Assert [getreg('s'), getregtype('s')] ==> ['avril', 'v']
+ Should getline(1) ==# '(herb unnamed pepper) salt water'
+ Should getline(2) ==# 'Super Sunnamed2ga Kawaii'
+ Should getline(3) ==# 'Sasara !@#$%^&*()! It''s burning!'
+ Should getline(4) ==# 'Alter, you are )(*&^%$#@! SSMK.'
+ Should getline(5) ==# 'I"m-amane'
+ Should getline(6) ==# 'You"re-avril'
+ Should [getreg('"'), getregtype('"')] ==# ['unnamed4', 'v']
+ Should [getreg('s'), getregtype('s')] ==# ['avril', 'v']
endfunction
-function s:test_usage_char_vs_line() "{{{1
- Title "Usage: char {motion} vs line {register} content"
+function s:describe__usage_char_vs_line() "{{{1
+ It "Usage: char {motion} vs line {register} content"
tabnew
tabonly!
@@ -232,16 +238,16 @@ function s:test_usage_char_vs_line() "{{{1
\ ]
silent put =text
1 delete _
- Assert getline(1, line('$')) ==> text
+ Should getline(1, line('$')) ==# text
" FIXME: NIY - but what result I expect for this case?
endfunction
-function s:test_usage_line_vs_block() "{{{1
- Title "Usage: line {motion} vs block {register} content"
+function s:describe__usage_line_vs_block() "{{{1
+ It "Usage: line {motion} vs block {register} content"
tabnew
tabonly!
@@ -253,16 +259,16 @@ function s:test_usage_line_vs_block() "{{{1
\ ]
silent put =text
1 delete _
- Assert getline(1, line('$')) ==> text
+ Should getline(1, line('$')) ==# text
" FIXME: NIY - but what result I expect for this case?
endfunction
-function s:test_usage_line_vs_char() "{{{1
- Title "Usage: line {motion} vs char {register} content"
+function s:describe__usage_line_vs_char() "{{{1
+ It "Usage: line {motion} vs char {register} content"
tabnew
tabonly!
@@ -274,16 +280,16 @@ function s:test_usage_line_vs_char() "{{{1
\ ]
silent put =text
1 delete _
- Assert getline(1, line('$')) ==> text
+ Should getline(1, line('$')) ==# text
" FIXME: NIY - but what result I expect for this case?
endfunction
-function s:test_usage_line_vs_line() "{{{1
- Title "Usage: line {motion} vs line {register} content"
+function s:describe__usage_line_vs_line() "{{{1
+ It "Usage: line {motion} vs line {register} content"
tabnew
tabonly!
@@ -298,108 +304,106 @@ function s:test_usage_line_vs_line() "{{{1
\ ]
silent put =text
1 delete _
- Assert getline(1, line('$')) ==> text
+ Should getline(1, line('$')) ==# text
" Case 1: {operator}{linewise-motion} without register designation
normal! 1G
let @" = "unnamed1\n"
let @s = "Spiral1\n"
- Assert [getreg('"'), getregtype('"')] ==> ["unnamed1\n", 'V']
- Assert [getreg('s'), getregtype('s')] ==> ["Spiral1\n", 'V']
+ Should [getreg('"'), getregtype('"')] ==# ["unnamed1\n", 'V']
+ Should [getreg('s'), getregtype('s')] ==# ["Spiral1\n", 'V']
execute 'normal' "\<Plug>(operator-replace)\<Plug>(operator-replace)"
- Assert getline(1) ==> 'unnamed1'
- Assert getline(2) ==> 'Super Super Mega Kawaii'
- Assert getline(3) ==> 'Sasara moe! It''s burning!'
- Assert getline(4) ==> 'Alter, you are also SSMK.'
- Assert getline(5) ==> 'I"m-happy.'
- Assert getline(6) ==> 'You"re-happy.'
- Assert [getreg('"'), getregtype('"')] ==> ["unnamed1\n", 'V']
- Assert [getreg('s'), getregtype('s')] ==> ["Spiral1\n", 'V']
+ Should getline(1) ==# 'unnamed1'
+ Should getline(2) ==# 'Super Super Mega Kawaii'
+ Should getline(3) ==# 'Sasara moe! It''s burning!'
+ Should getline(4) ==# 'Alter, you are also SSMK.'
+ Should getline(5) ==# 'I"m-happy.'
+ Should getline(6) ==# 'You"re-happy.'
+ Should [getreg('"'), getregtype('"')] ==# ["unnamed1\n", 'V']
+ Should [getreg('s'), getregtype('s')] ==# ["Spiral1\n", 'V']
" Case 2: {linewise-Visual}{operator} without register designation
normal! 2G
let @" = "unnamed2\n"
let @s = "Spiral2\n"
- Assert [getreg('"'), getregtype('"')] ==> ["unnamed2\n", 'V']
- Assert [getreg('"'), getregtype('"')] ==> ["unnamed2\n", 'V']
+ Should [getreg('"'), getregtype('"')] ==# ["unnamed2\n", 'V']
+ Should [getreg('"'), getregtype('"')] ==# ["unnamed2\n", 'V']
execute 'normal' "Vwl\<Plug>(operator-replace)"
- Assert getline(1) ==> 'unnamed1'
- Assert getline(2) ==> 'unnamed2'
- Assert getline(3) ==> 'Sasara moe! It''s burning!'
- Assert getline(4) ==> 'Alter, you are also SSMK.'
- Assert getline(5) ==> 'I"m-happy.'
- Assert getline(6) ==> 'You"re-happy.'
- Assert [getreg('"'), getregtype('"')] ==> ["unnamed2\n", 'V']
- Assert [getreg('s'), getregtype('s')] ==> ["Spiral2\n", 'V']
+ Should getline(1) ==# 'unnamed1'
+ Should getline(2) ==# 'unnamed2'
+ Should getline(3) ==# 'Sasara moe! It''s burning!'
+ Should getline(4) ==# 'Alter, you are also SSMK.'
+ Should getline(5) ==# 'I"m-happy.'
+ Should getline(6) ==# 'You"re-happy.'
+ Should [getreg('"'), getregtype('"')] ==# ["unnamed2\n", 'V']
+ Should [getreg('s'), getregtype('s')] ==# ["Spiral2\n", 'V']
" Case 3: {operator}{linewise-motion} with register designation
normal! 3G
let @" = "unnamed3\n"
let @s = "Spiral3\n"
- Assert [getreg('"'), getregtype('"')] ==> ["unnamed3\n", 'V']
- Assert [getreg('s'), getregtype('s')] ==> ["Spiral3\n", 'V']
+ Should [getreg('"'), getregtype('"')] ==# ["unnamed3\n", 'V']
+ Should [getreg('s'), getregtype('s')] ==# ["Spiral3\n", 'V']
execute 'normal' "\"s\<Plug>(operator-replace)\<Plug>(operator-replace)"
- Assert getline(1) ==> 'unnamed1'
- Assert getline(2) ==> 'unnamed2'
- Assert getline(3) ==> 'Spiral3'
- Assert getline(4) ==> 'Alter, you are also SSMK.'
- Assert getline(5) ==> 'I"m-happy.'
- Assert getline(6) ==> 'You"re-happy.'
- Assert [getreg('"'), getregtype('"')] ==> ["unnamed3\n", 'V']
- Assert [getreg('s'), getregtype('s')] ==> ["Spiral3\n", 'V']
+ Should getline(1) ==# 'unnamed1'
+ Should getline(2) ==# 'unnamed2'
+ Should getline(3) ==# 'Spiral3'
+ Should getline(4) ==# 'Alter, you are also SSMK.'
+ Should getline(5) ==# 'I"m-happy.'
+ Should getline(6) ==# 'You"re-happy.'
+ Should [getreg('"'), getregtype('"')] ==# ["unnamed3\n", 'V']
+ Should [getreg('s'), getregtype('s')] ==# ["Spiral3\n", 'V']
" Case 4: {linewise-Visual}{operator} with register designation
normal! 4G
let @" = "unnamed4\n"
let @s = "Spiral4\n"
- Assert [getreg('"'), getregtype('"')] ==> ["unnamed4\n", 'V']
- Assert [getreg('s'), getregtype('s')] ==> ["Spiral4\n", 'V']
+ Should [getreg('"'), getregtype('"')] ==# ["unnamed4\n", 'V']
+ Should [getreg('s'), getregtype('s')] ==# ["Spiral4\n", 'V']
execute 'normal' "Veh\"s\<Plug>(operator-replace)"
- Assert getline(1) ==> 'unnamed1'
- Assert getline(2) ==> 'unnamed2'
- Assert getline(3) ==> 'Spiral3'
- Assert getline(4) ==> 'Spiral4'
- Assert getline(5) ==> 'I"m-happy.'
- Assert getline(6) ==> 'You"re-happy.'
- Assert [getreg('"'), getregtype('"')] ==> ["unnamed4\n", 'V']
- Assert [getreg('s'), getregtype('s')] ==> ["Spiral4\n", 'V']
+ Should getline(1) ==# 'unnamed1'
+ Should getline(2) ==# 'unnamed2'
+ Should getline(3) ==# 'Spiral3'
+ Should getline(4) ==# 'Spiral4'
+ Should getline(5) ==# 'I"m-happy.'
+ Should getline(6) ==# 'You"re-happy.'
+ Should [getreg('"'), getregtype('"')] ==# ["unnamed4\n", 'V']
+ Should [getreg('s'), getregtype('s')] ==# ["Spiral4\n", 'V']
" Case 5: {operator}{linewise-motion} including the end of buffer
normal! 5G
let @" = "unnamed5\n"
let @s = "Spiral5\n"
- Assert [getreg('"'), getregtype('"')] ==> ["unnamed5\n", 'V']
- Assert [getreg('s'), getregtype('s')] ==> ["Spiral5\n", 'V']
+ Should [getreg('"'), getregtype('"')] ==# ["unnamed5\n", 'V']
+ Should [getreg('s'), getregtype('s')] ==# ["Spiral5\n", 'V']
execute 'normal' "\"\"\<Plug>(operator-replace)j"
- Assert getline(1) ==> 'unnamed1'
- Assert getline(2) ==> 'unnamed2'
- Assert getline(3) ==> 'Spiral3'
- Assert getline(4) ==> 'Spiral4'
- Assert getline(5) ==> 'unnamed5'
- Assert line('$') ==> 5
- Assert [getreg('"'), getregtype('"')] ==> ["unnamed5\n", 'V']
- Assert [getreg('s'), getregtype('s')] ==> ["Spiral5\n", 'V']
+ Should getline(1) ==# 'unnamed1'
+ Should getline(2) ==# 'unnamed2'
+ Should getline(3) ==# 'Spiral3'
+ Should getline(4) ==# 'Spiral4'
+ Should getline(5) ==# 'unnamed5'
+ Should line('$') ==# 5
+ Should [getreg('"'), getregtype('"')] ==# ["unnamed5\n", 'V']
+ Should [getreg('s'), getregtype('s')] ==# ["Spiral5\n", 'V']
" Case 6: {linewise-Visual}{operator} including the end of buffer
normal! 5G
let @" = "unnamed6\n"
let @s = "Spiral6\n"
- Assert [getreg('"'), getregtype('"')] ==> ["unnamed6\n", 'V']
- Assert [getreg('s'), getregtype('s')] ==> ["Spiral6\n", 'V']
+ Should [getreg('"'), getregtype('"')] ==# ["unnamed6\n", 'V']
+ Should [getreg('s'), getregtype('s')] ==# ["Spiral6\n", 'V']
execute 'normal' "Vk\"\"\<Plug>(operator-replace)"
- Assert getline(1) ==> 'unnamed1'
- Assert getline(2) ==> 'unnamed2'
- Assert getline(3) ==> 'Spiral3'
- Assert getline(4) ==> 'unnamed6'
- Assert line('$') ==> 4
- Assert [getreg('"'), getregtype('"')] ==> ["unnamed6\n", 'V']
- Assert [getreg('s'), getregtype('s')] ==> ["Spiral6\n", 'V']
+ Should getline(1) ==# 'unnamed1'
+ Should getline(2) ==# 'unnamed2'
+ Should getline(3) ==# 'Spiral3'
+ Should getline(4) ==# 'unnamed6'
+ Should line('$') ==# 4
+ Should [getreg('"'), getregtype('"')] ==# ["unnamed6\n", 'V']
+ Should [getreg('s'), getregtype('s')] ==# ["Spiral6\n", 'V']
endfunction
-Test "{{{1
-
-" __END__
+" __END__ "{{{1
" vim: filetype=vim foldmethod=marker

0 comments on commit c4d42b9

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