Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@chrisbra
Copy link
Member

This is work in progress. I just want to see how coveralls changes. Will notify once this is ready to be included.

@chrisbra chrisbra changed the title Test ins_del function Increase Test coverage for edit.c Feb 27, 2017
@chrisbra chrisbra force-pushed the test_edit branch 3 times, most recently from e1dd904 to 6ba644e Compare March 1, 2017 19:58
endfunc

func! Test_edit_CTRL_()
" disabled for Windows builds, why?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps, because you use non-ASCII characters in this script?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know. I tried setting encoding explicitly to utf-8 but that does not work. I am possibly missing some ifdef feature or something. See this and that. The second one is especially mysterious, since at the specified line encoding is reset and all :bw commands use the ! attribute. So for now I have disabled this test, until the test_edit script is finished and then will check again.

This PR adds many tests, that should increase the coverage for edit.c by
quite a lot.

Also to make testing easier there are two small changes to the C core of
Vim:
1) A new function test_disable(name, val)
   this can be used to have redrawing() always return false (similar to
   how test_disable_char_avail() function currently works
2) a function that checks if Vim was called with --not-a-term argument
   and in that case skip the 2s delay when displaying error messages

The rest should be self explanatory
@chrisbra
Copy link
Member Author

chrisbra commented Mar 6, 2017

rebased to 8.0.0425

set foldopen+=hor
call setline(1, ['abc', 'def'])
call cursor(1, 1)
call feedkeys("AX\<Home>X\<esc>", 'tnix')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You insert the same letter X at the beginning and at the end.
Better insert a different letter (like "XabcY") because if and were swapped, your test would spuriously pass.
It may also be worth checking and when setting 'rightleft'.

call feedkeys("A\<c-t>xyz", 'tnix')
call assert_equal(["\<tab>abcxyz"], getline(1, '$'))
set nopaste
" CTRL-X CTRL-T (thesaurus complete
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing closing parenthesis.

call cursor(1, 1)
call feedkeys("i\<Insert>Z\<Insert>YX>", 'tnix')
call assert_equal(['ZYX>bc', 'def'], getline(1, '$'))
endfunc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing bw! before returning from the test?

@chrisbra
Copy link
Member Author

chrisbra commented Mar 6, 2017

thanks @dpelle I updated the test acccording to your comments.

@brammool
Copy link
Contributor

brammool commented Mar 9, 2017

Is this ready to include now?

@chrisbra
Copy link
Member Author

chrisbra commented Mar 9, 2017

yes it is ready. You might want to review the changes to the C Core however.

@brammool
Copy link
Contributor

brammool commented Mar 9, 2017 via email

@chrisbra
Copy link
Member Author

chrisbra commented Mar 9, 2017

@brammool adjusted according to your comments.
regarding point

  1. it is there to make sure, that this part of the code is run through while testing, I think there was an error in the test script so I changed is slightly.
  2. renamed test_disable to test_override, allow extra argument "ALL", removed the test_disable_char_avail() function and changed all other tests to use the new test_override function.
  3. changed the --not-a-term check and let it test against v:testing.

@brammool
Copy link
Contributor

brammool commented Mar 9, 2017 via email

@brammool brammool closed this in eb992cb Mar 9, 2017
chrisbra pushed a commit to chrisbra/vim that referenced this pull request Mar 25, 2017
Problem:    Not enough test coverage in Insert mode.
Solution:   Add lots of tests.  Add test_override(). (Christian Brabandt,
            closes vim#1521)
@chrisbra chrisbra deleted the test_edit branch March 28, 2017 17:28
chrisbra pushed a commit to chrisbra/vim that referenced this pull request Mar 28, 2017
Problem:    Not enough test coverage in Insert mode.
Solution:   Add lots of tests.  Add test_override(). (Christian Brabandt,
            closes vim#1521)
desvp pushed a commit to desvp/vim that referenced this pull request May 30, 2017
Problem:    Not enough test coverage in Insert mode.
Solution:   Add lots of tests.  Add test_override(). (Christian Brabandt,
            closes vim#1521)
justinmk added a commit to justinmk/neovim that referenced this pull request Feb 1, 2018
[Nvim note: test_override() omitted]

Problem:    Not enough test coverage in Insert mode.
Solution:   Add lots of tests.  Add test_override(). (Christian Brabandt,
            closes vim/vim#1521)
vim/vim@eb992cb
justinmk added a commit to justinmk/neovim that referenced this pull request Feb 3, 2018
[Nvim note: test_override() omitted]

Problem:    Not enough test coverage in Insert mode.
Solution:   Add lots of tests.  Add test_override(). (Christian Brabandt,
            closes vim/vim#1521)
vim/vim@eb992cb
justinmk added a commit to justinmk/neovim that referenced this pull request Feb 11, 2018
[Nvim note: test_override() omitted]

Problem:    Not enough test coverage in Insert mode.
Solution:   Add lots of tests.  Add test_override(). (Christian Brabandt,
            closes vim/vim#1521)
vim/vim@eb992cb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants