aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_textobjects.vim
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-08-24 09:09:46 +0200
committerGitHub <noreply@github.com>2018-08-24 09:09:46 +0200
commit2ab80b944bad532113023dc967dc58af654bef23 (patch)
tree8b12674904464a88a271e090063a8dcf45c488dc /src/nvim/testdir/test_textobjects.vim
parent925c153f86908a601a19d0142d8c601cf35df88a (diff)
parent748cd91c20bdffe34ac5c9997ac8342cdf9438e1 (diff)
downloadrneovim-2ab80b944bad532113023dc967dc58af654bef23.tar.gz
rneovim-2ab80b944bad532113023dc967dc58af654bef23.tar.bz2
rneovim-2ab80b944bad532113023dc967dc58af654bef23.zip
Merge #8896 from janlazo/vim-8.1.0083
Diffstat (limited to 'src/nvim/testdir/test_textobjects.vim')
-rw-r--r--src/nvim/testdir/test_textobjects.vim75
1 files changed, 75 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_textobjects.vim b/src/nvim/testdir/test_textobjects.vim
index 52c0c3698e..6a2f5044cc 100644
--- a/src/nvim/testdir/test_textobjects.vim
+++ b/src/nvim/testdir/test_textobjects.vim
@@ -182,3 +182,78 @@ x
norm it
q!
endfunc
+
+func Test_sentence()
+ enew!
+ call setline(1, 'A sentence. A sentence? A sentence!')
+
+ normal yis
+ call assert_equal('A sentence.', @")
+ normal yas
+ call assert_equal('A sentence. ', @")
+
+ normal )
+
+ normal yis
+ call assert_equal('A sentence?', @")
+ normal yas
+ call assert_equal('A sentence? ', @")
+
+ normal )
+
+ normal yis
+ call assert_equal('A sentence!', @")
+ normal yas
+ call assert_equal(' A sentence!', @")
+
+ normal 0
+ normal 2yis
+ call assert_equal('A sentence. ', @")
+ normal 3yis
+ call assert_equal('A sentence. A sentence?', @")
+ normal 2yas
+ call assert_equal('A sentence. A sentence? ', @")
+
+ %delete _
+endfunc
+
+func Test_sentence_with_quotes()
+ enew!
+ call setline(1, 'A "sentence." A sentence.')
+
+ normal yis
+ call assert_equal('A "sentence."', @")
+ normal yas
+ call assert_equal('A "sentence." ', @")
+
+ normal )
+
+ normal yis
+ call assert_equal('A sentence.', @")
+ normal yas
+ call assert_equal(' A sentence.', @")
+
+ %delete _
+endfunc
+
+func! Test_sentence_with_cursor_on_delimiter()
+ enew!
+ call setline(1, "A '([sentence.])' A sentence.")
+
+ normal! 15|yis
+ call assert_equal("A '([sentence.])'", @")
+ normal! 15|yas
+ call assert_equal("A '([sentence.])' ", @")
+
+ normal! 16|yis
+ call assert_equal("A '([sentence.])'", @")
+ normal! 16|yas
+ call assert_equal("A '([sentence.])' ", @")
+
+ normal! 17|yis
+ call assert_equal("A '([sentence.])'", @")
+ normal! 17|yas
+ call assert_equal("A '([sentence.])' ", @")
+
+ %delete _
+endfunc