-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] Screen conceal highlight tests #2055
Conversation
Nice work! Have you also considered testing e.g. |
Thanks, I'll clean that up. I've never used |
Hmm, it looks like you rebased master commits into your feature branch, you probably want to the opposite (rebase your feature branch on top of master) |
Sorry about that, this is my first time contributing to such a large repository. So you are saying that I should rebase my branch onto master and then rebase master onto the feature branch? Also, once a pull request is created is it recommended to keep it in sync with upstream? |
I am by no means a git expert, but I usually don't involve my local master branch at all when working on a feature branch, I do (on the feature branch)
(where |
I'll do that. So I should probably recreate this pull request so that there are no side-effects? Thanks! |
You can just force-push to the same branch ( |
That worked like a charm! 👍 |
:syn match dAmpersand '[&][&]' conceal cchar=∧ | | ||
]], {[1] = {foreground = Screen.colors.LightGrey, background = Screen.colors.DarkGray}}) | ||
end) | ||
it('&& Move Cursor Up', function() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a extra line above the it
statement.
Hmm, it seems like it is failing due to an actual redraw error (I can reproduce locally with my vimrc, but not with |
Actually |
seems issue in latest hg |
@McKizzle Nice work with testing all the different options ! Please rebase on master when you have time, it should fix some incorrect failures on travis. Also the test needs to be updated as the character under the cursor is no longer hidden in the screen expectations, i e |
Thanks! I'll get around to this later and update the tests to reflect the new screen expectations. |
@bfredl changes have been pushed. I'll look around and see if there are any additional UI tests that I can add. |
|
||
describe("Match", function() | ||
|
||
describe("Multiple", function() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two describe
s could be joined. Perhaps a more descriptive header like describe("supports multiple matches",
?
While tests are nice, the titles could be a bit more descriptive. Note that
and busted will mention the individual test as "concealing supports multiple matches and moving the cursor up" and "concealing handles conceallevel 2" and so on. |
@bfredl it would look cleaner that way. I'll combine those describes. Is there a testing style guide available on the wiki or in the docs? I did a search, but didn't find any. |
No, I have mostly followed earlier tests myself, as well as looking a bit in busted documentation, but perhaps a few lines should be added to the wiki somewhere (there is https://github.com/neovim/neovim/wiki/Unit-tests but it is about the "contents" of the tests and not the style) |
OK. |
Hello @bfredl. Sorry for the absence. Was in the process of getting a new job and moving to a new location. Is there a way to make busted print out the tests verbosely instead of as green dots? I noticed that busted lets you register your own output types, but I'm not sure how I would go about passing that in into |
No hurry :) The simplest way, seems to be changing the line in |
This also works (when standing in neovim, and already ran |
Thanks, I'll give that a try. That information is quite useful, I could add that to the Unit tests wiki page. Unless the Building Neovim page is a better location. |
Using the other tests as a point of reference the new output looks like this.
|
|
||
describe("a region of text", function() | ||
local syn_region_i_text = "syn region iText start='<i>' end='</i>' cchar=*" | ||
local conceal_on = "syntax conceal on" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these, at least conceal_on
and conceal_off
, should be eliminated and the full command just put inside execute()
. It is clearer if the command is just entered where it actually is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do that then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll keep it consistent and remove the syn_region_i_text
variable also.
Nice! some additional comments, otherwise LGTM. 👍 If you want to do more screen tests (after this PR), it might be good to know that you can pass a screen size to |
Thanks! Being able to modify the screen dimensions is helpful. I'll go through and minimize the height of the screens (they were making the file to large) and tidy up the code some more. |
Sorry, I was a bit busy with other stuff and forgot about this PR. Please rebase and squash. |
No problem! Rebased and squashed the branch. |
Merged, thanks! |
Yay! Should I close this branch now? |
Yes, you can delete the branch.
|
Deleted the previous pull request (https://github.com/neovim/neovim/pull/2044)[https://github.com/neovim/neovim/pull/2044], added changes, created a feature branch, and fixed the commit message. Removed the search highlighting tests since (https://github.com/neovim/neovim/pull/1930)[https://github.com/neovim/neovim/pull/1930] already has several in place. @bfredl once your pull request is accepted I could add the extra highlighting tests into
test/functional/ui/searchhl_spec.lua
#1930 later.