[vim/vim] Improved test coverage for tabpages (#2934)

17 views
Skip to first unread message

Dominique Pellé

unread,
May 20, 2018, 8:14:17 AM5/20/18
to vim/vim, Subscribed

This PR improves test coverage for tabpages:

1/ The :tabs ex command was not tested according to codecov:
https://codecov.io/gh/vim/vim/src/master/src/ex_docmd.c#L8388

2/ Normal commands <C-PageUp> and <C-PageDown> to switch
pages were also not tested:
https://codecov.io/gh/vim/vim/src/master/src/normal.c#L4207

While adding tests, I found that {count}<C-PageUp> and
{count}<C-PageDown> are not symmetrical, which I find
counter-intuitive:

  • {count}<C-PageUp> goes {count} pages downward (relative count)
  • {count}<C-PageDown> goes to page number {count} (absolute count)

That's also the behavior according to help page so it looks
intentional. Same remark for normal gt and gT commands which are
also not symmetrical with a count.

Also, using PageUp to go downward and PageDown to go upward
is rather counter-intuitive to me. I almost never use tabpages
myself, so I never realized this until now.


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

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

Commit Summary

  • Improved test coverage for tabpages

File Changes

Patch Links:


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

Codecov

unread,
May 20, 2018, 8:54:01 AM5/20/18
to vim/vim, Subscribed

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2934      +/-   ##
==========================================
+ Coverage   75.69%   75.72%   +0.02%     
==========================================
  Files          92       92              
  Lines      135014   135013       -1     
==========================================
+ Hits       102201   102237      +36     
+ Misses      32813    32776      -37
Impacted Files Coverage Δ
src/if_xcmdsrv.c 84.35% <0%> (-0.36%) ⬇️
src/term.c 59.56% <0%> (-0.06%) ⬇️
src/os_unix.c 54.48% <0%> (-0.05%) ⬇️
src/if_py_both.h 76.59% <0%> (-0.01%) ⬇️
src/gui.c 49.35% <0%> (ø) ⬆️
src/window.c 82.2% <0%> (+0.06%) ⬆️
src/normal.c 74.08% <0%> (+0.07%) ⬆️
src/channel.c 83.15% <0%> (+0.07%) ⬆️
src/ex_cmds.c 79.46% <0%> (+0.08%) ⬆️
src/gui_gtk_x11.c 47.98% <0%> (+0.09%) ⬆️
... and 3 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 42ab17b...e7a28de. Read the comment docs.

Bram Moolenaar

unread,
May 20, 2018, 8:58:04 AM5/20/18
to vim/vim, Subscribed

Closed #2934 via dbe8869.

Christian Brabandt

unread,
May 20, 2018, 12:53:02 PM5/20/18
to vim/vim, Subscribed

While adding tests, I found that {count} and
{count} are not symmetrical, which I find
counter-intuitive:

I also stumbled over the inconsistent behaviour a while back:
https://groups.google.com/d/msg/vim_dev/CTIIpzvcATY/klAn5voCCAAJ

Perhaps, it should be mentioned in the documentation, that the behaviour is not symmetrical?

Bram Moolenaar

unread,
May 21, 2018, 7:29:51 AM5/21/18
to vim/vim, Subscribed

Christian wrote:

> > While adding tests, I found that {count}<C-PageUp> and
> > {count}<C-PageDown> are not symmetrical, which I find
> > counter-intuitive:
>
> I also stumbled over the inconsistent behaviour a while back:
> https://groups.google.com/d/msg/vim_dev/CTIIpzvcATY/klAn5voCCAAJ
>
> Perhaps, it should be mentioned in the documentation, that the
> behaviour is not symmetrical?

I thought the text was clear, but since it keeps coming up, I'll add a
note.

--
BODY: I'm not dead!
CART DRIVER: 'Ere. He says he's not dead.
LARGE MAN: Yes he is.
BODY: I'm not!
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages