[vim/vim] Add additional tests for ex_docmd.c based on code coverage (#5659)

7 views
Skip to first unread message

Yegappan Lakshmanan

unread,
Feb 18, 2020, 12:29:18 PM2/18/20
to vim/vim, Subscribed

You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/5659

Commit Summary

  • Add additional tests for ex_docmd.c

File Changes

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Dominique Pellé

unread,
Feb 18, 2020, 2:11:09 PM2/18/20
to vim/vim, Subscribed

@dpelle commented on this pull request.


In src/testdir/test_arglist.vim:

> @@ -519,6 +519,18 @@ func Test_quit_with_arglist()

   call term_sendkeys(buf, ":quit\n")

   call WaitForAssert({-> assert_match('^E173:', term_getline(buf, 6))})

   call StopVimInTerminal(buf)

+

+  " Try :confirm quit with unedited files in arglist

+  let buf = RunVimInTerminal('', {'rows': 6})

+  call term_sendkeys(buf, ":set nomore\n")

+  call term_sendkeys(buf, ":args a b c\n")

+  call term_sendkeys(buf, ":confirm quit\n")

+  call WaitForAssert({-> assert_match('\[Y\]es, (N)o: ', term_getline(buf, 6))})

+  call term_sendkeys(buf, "N")

+  call term_sendkeys(buf, ":confirm quit\n")

+  call WaitForAssert({-> assert_match('\[Y\]es, (N)o: ', term_getline(buf, 6))})

Can't that be more precise with something like…

assert_match('^\[Y\]es, (N)o: *$', term_getline(buf, 6))

Yegappan Lakshmanan

unread,
Feb 18, 2020, 2:29:26 PM2/18/20
to vim_dev, reply+ACY5DGEY3V6A44WID3...@reply.github.com, vim/vim, Subscribed
Hi,

On Tue, Feb 18, 2020 at 11:11 AM Dominique Pellé <vim-dev...@256bit.org> wrote:

@dpelle commented on this pull request.


In src/testdir/test_arglist.vim:

> @@ -519,6 +519,18 @@ func Test_quit_with_arglist()

   call term_sendkeys(buf, ":quit\n")

   call WaitForAssert({-> assert_match('^E173:', term_getline(buf, 6))})

   call StopVimInTerminal(buf)

+

+  " Try :confirm quit with unedited files in arglist

+  let buf = RunVimInTerminal('', {'rows': 6})

+  call term_sendkeys(buf, ":set nomore\n")

+  call term_sendkeys(buf, ":args a b c\n")

+  call term_sendkeys(buf, ":confirm quit\n")

+  call WaitForAssert({-> assert_match('\[Y\]es, (N)o: ', term_getline(buf, 6))})

+  call term_sendkeys(buf, "N")

+  call term_sendkeys(buf, ":confirm quit\n")

+  call WaitForAssert({-> assert_match('\[Y\]es, (N)o: ', term_getline(buf, 6))})

Can't that be more precise with something like…

assert_match('^\[Y\]es, (N)o: *$', term_getline(buf, 6))

Yes. It can be more precise. I will update the PR.

Regards,
Yegappan
 

vim-dev ML

unread,
Feb 18, 2020, 2:29:33 PM2/18/20
to vim/vim, vim-dev ML, Your activity
Hi,

On Tue, Feb 18, 2020 at 11:11 AM Dominique Pellé <vim-dev...@256bit.org>
wrote:

> *@dpelle* commented on this pull request.
> ------------------------------
>
> In src/testdir/test_arglist.vim
> <https://github.com/vim/vim/pull/5659#discussion_r380876485>:

>
> > @@ -519,6 +519,18 @@ func Test_quit_with_arglist()
>
> call term_sendkeys(buf, ":quit\n")
>
> call WaitForAssert({-> assert_match('^E173:', term_getline(buf, 6))})
>
> call StopVimInTerminal(buf)
>
> +
>
> + " Try :confirm quit with unedited files in arglist
>
> + let buf = RunVimInTerminal('', {'rows': 6})
>
> + call term_sendkeys(buf, ":set nomore\n")
>
> + call term_sendkeys(buf, ":args a b c\n")
>
> + call term_sendkeys(buf, ":confirm quit\n")
>
> + call WaitForAssert({-> assert_match('\[Y\]es, (N)o: ', term_getline(buf, 6))})
>
> + call term_sendkeys(buf, "N")
>
> + call term_sendkeys(buf, ":confirm quit\n")
>
> + call WaitForAssert({-> assert_match('\[Y\]es, (N)o: ', term_getline(buf, 6))})
>
>
> Can't that be more precise with something like…
>
> assert_match('^\[Y\]es, (N)o: *$', term_getline(buf, 6))
>
>
Yes. It can be more precise. I will update the PR.

Regards,
Yegappan

Yegappan Lakshmanan

unread,
Feb 18, 2020, 3:00:13 PM2/18/20
to vim/vim, vim-dev ML, Push

@yegappan pushed 1 commit.

  • facf75b Add more specific regexp pattern


You are receiving this because you are subscribed to this thread.

View it on GitHub or unsubscribe.

Codecov

unread,
Feb 18, 2020, 3:29:11 PM2/18/20
to vim/vim, vim-dev ML, Comment

Codecov Report

Merging #5659 into master will increase coverage by 0.04%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@

##           master    #5659      +/-   ##

==========================================

+ Coverage   83.41%   83.46%   +0.04%     

==========================================

  Files         138      138              

  Lines      152064   152064              

==========================================

+ Hits       126848   126915      +67     

+ Misses      25216    25149      -67
Impacted Files Coverage Δ
src/drawline.c 84.67% <0%> (-0.14%) ⬇️
src/terminal.c 82.43% <0%> (ø) ⬆️
src/window.c 88.59% <0%> (+0.03%) ⬆️
src/ops.c 89.71% <0%> (+0.04%) ⬆️
src/gui.c 63.68% <0%> (+0.05%) ⬆️
src/evalvars.c 87.41% <0%> (+0.06%) ⬆️
src/normal.c 83.71% <0%> (+0.06%) ⬆️
src/search.c 83.96% <0%> (+0.15%) ⬆️
src/change.c 82.29% <0%> (+0.2%) ⬆️
src/os_unix.c 63.78% <0%> (+0.22%) ⬆️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1fa8d2c...facf75b. Read the comment docs.


You are receiving this because you commented.

Bram Moolenaar

unread,
Feb 18, 2020, 3:54:56 PM2/18/20
to vim/vim, vim-dev ML, Comment

Closed #5659 via 406cd90.


You are receiving this because you commented.

Reply all
Reply to author
Forward
0 new messages