Tests for Text Objects, Todo.txt Line 5081

23 views
Skip to first unread message

William Banquier

unread,
Nov 15, 2024, 7:57:05 PM11/15/24
to vim_dev
Hello vim-dev mailing list,
My name is William Banquier. I was hoping to contribute to the project for the first time and I saw in Todo.txt there is a line (line number 5081 as of November 15th, 2024) saying: "8   Add test script for text object commands "aw", "iW", etc." I was wondering if this has been completed. I understand there is a file "src/testdir/test_textobjects.vim" that contains tests for text objects i.e. line 418 is the header for a function that tests "aw". 

I am wondering if I could have some guidance on whether tests for text object have been completed and if so, if there were other tests that I could help contribute to. If text object tests are not fully completed I was wondering if there was a document other than the code coverage report that might contain more details for what I would need to add to help test. 

I am extremely eager to help contribute as I really enjoy using vim and I would like to try to give back, I can't wait to hear back.
Best regards,
William Banquier.


Yegappan Lakshmanan

unread,
Nov 15, 2024, 10:57:50 PM11/15/24
to vim...@googlegroups.com
Hello,

On Fri, Nov 15, 2024 at 4:57 PM William Banquier <wban...@gmail.com> wrote:
Hello vim-dev mailing list,
My name is William Banquier. I was hoping to contribute to the project for the first time and I saw in Todo.txt there is a line (line number 5081 as of November 15th, 2024) saying: "8   Add test script for text object commands "aw", "iW", etc." I was wondering if this has been completed. I understand there is a file "src/testdir/test_textobjects.vim" that contains tests for text objects i.e. line 418 is the header for a function that tests "aw". 


Thanks for offering to help.  That todo item is no longer applicable as tests for the text objects (aw and iW) were added
around 2020.  The todo.txt file needs to be updated to remove that item.
 
I am wondering if I could have some guidance on whether tests for text object have been completed and if so, if there were other tests that I could help contribute to. If text object tests are not fully completed I was wondering if there was a document other than the code coverage report that might contain more details for what I would need to add to help test. 

I am extremely eager to help contribute as I really enjoy using vim and I would like to try to give back, I can't wait to hear back.
Best regards,
William Banquier.

You can either look at the Github issues tracker (https://github.com/vim/vim/issues) or the todo.txt file and pick
an item that you can tackle.

Regards,
Yegappan

Christian Brabandt

unread,
Nov 16, 2024, 8:06:35 AM11/16/24
to vim...@googlegroups.com
Thanks for offering help, that is clearly appreciated. If you want to
get started, I'd recommend to go through the huge lists of issues and
see if find some that no longer applies. You don't need to go through
all of them, start with some that you can clearly understand and try to
reproduce them. If you already know a bit of C, you may also try to find
the code and see if you can fix it. Start with some small issues or pick
one that personally annoys you.

But please note, Vim is a mature open source project, the code is not
always easy to follow and getting it included may take some time. Please
try to include a test case for whatever you change.

Going through the code coverage as you offered is also a good way to
find sections of code that isn't yet covered by tests. But I believe it
may be hard to find things not yet tested, e.g. because memory failure
issues are not tested, because it is hard to make tests cause those
issues and test that properly. But there might still be places that
could be improved.

If you don't want to spend your time on the C code, you may chose to
improve either some of the existing distributed Vim plugins using either
Vim9 script of the legacy code or even write tests for those. For
example we do not currently have a test for the commenter and netrw
plugin.

And if you are not a programmer at all, you can still check the
documentation or translation files if they are correct or can be
improved.

Thanks,
Christian
--
"Necessity is the mother of invention" is a silly proverb. "Necessity
is the mother of futile dodges" is much nearer the truth.
-- Alfred North Whitehead

William Banquier

unread,
Nov 19, 2024, 5:00:27 PM11/19/24
to vim_dev
Hello,
Thank you both so much for the insightful responses -- I would be super interested in working on writing tests for the netrw plugin -- just to ask some fairly obvious questions (1) should my test file be src/testdir/test_netrwPlugin.vim and (2) with respect to the text in the Contributing.md should I just create a pull request once I am done and then after a little bit of code review it will be merged? Are there any differing processes for adding test cases?

Sorry for the questions, I am very excited to contribute,
Best regards,
William.
Reply all
Reply to author
Forward
0 new messages