[vim/vim] Add additional tests for bufwrite.c (#8192)

16 views
Skip to first unread message

Yegappan Lakshmanan

unread,
May 9, 2021, 4:37:06 PM5/9/21
to vim/vim, Subscribed

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

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

Commit Summary

  • Add additional tests for bufwrite.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.

codecov[bot]

unread,
May 9, 2021, 4:44:08 PM5/9/21
to vim/vim, Subscribed

Codecov Report

Merging #8192 (53c59da) into master (918b089) will decrease coverage by 86.88%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@

##           master    #8192       +/-   ##

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

- Coverage   89.35%    2.46%   -86.89%     

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

  Files         148      146        -2     

  Lines      166793   161660     -5133     

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

- Hits       149038     3990   -145048     

- Misses      17755   157670   +139915     
Flag Coverage Δ
huge-clang-none ?
huge-gcc-none ?
huge-gcc-testgui ?
huge-gcc-unittests 2.46% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/sha256.c 0.00% <0.00%> (-97.96%) ⬇️
src/digraph.c 0.00% <0.00%> (-97.78%) ⬇️
src/gui_gtk_f.c 0.00% <0.00%> (-97.54%) ⬇️
src/match.c 0.00% <0.00%> (-97.13%) ⬇️
src/crypt_zip.c 0.00% <0.00%> (-97.06%) ⬇️
src/evalbuffer.c 0.00% <0.00%> (-96.83%) ⬇️
src/debugger.c 0.00% <0.00%> (-96.62%) ⬇️
src/libvterm/src/rect.h 0.00% <0.00%> (-96.56%) ⬇️
src/textprop.c 0.00% <0.00%> (-96.41%) ⬇️
src/evalfunc.c 0.00% <0.00%> (-96.18%) ⬇️
... and 134 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 918b089...53c59da. Read the comment docs.

Dominique Pellé

unread,
May 9, 2021, 5:26:05 PM5/9/21
to vim/vim, Subscribed

@dpelle commented on this pull request.


In src/testdir/test_writefile.vim:

> @@ -58,7 +58,16 @@ func Test_writefile_fails_conversion()

   call assert_fails('write ++enc=cp932', 'E513:')

   call assert_equal(contents, readfile('Xfile'))

 

+  " With 'backupcopy' set, if there is a conversion error, the backup file is

+  " still creaetd.

typo: creatd → created


In src/testdir/test_writefile.vim:

> @@ -257,6 +269,15 @@ func Test_write_errors()

   let long_fname = repeat('n', 5000)

   call assert_fails('exe "w " .. long_fname', 'E75:')

   call assert_fails('call writefile([], long_fname)', 'E482:')

+

+  " Test for writing to a block device on Unix-like systems

+  if has('unix') && getfperm('/dev/loop0') != ''

Maybe safer if we also check getftype('/dev/loop0') == 'bdev'?

I also wonder what happens if we run this test as root.

Yegappan Lakshmanan

unread,
May 10, 2021, 12:10:52 AM5/10/21
to vim/vim, Subscribed

@yegappan commented on this pull request.


In src/testdir/test_writefile.vim:

> @@ -257,6 +269,15 @@ func Test_write_errors()
   let long_fname = repeat('n', 5000)
   call assert_fails('exe "w " .. long_fname', 'E75:')
   call assert_fails('call writefile([], long_fname)', 'E482:')
+
+  " Test for writing to a block device on Unix-like systems
+  if has('unix') && getfperm('/dev/loop0') != ''

I ran the test as root and the test passed.

I see some other test failure in FreeBSD (Cirrus CI). I am not able to reproduce this failure in my local FreeBSD system.

Yegappan Lakshmanan

unread,
May 10, 2021, 12:12:23 AM5/10/21
to vim/vim, Push

@yegappan pushed 1 commit.

  • 6c9a4ee Incorporate review comments


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

View it on GitHub or unsubscribe.

Bram Moolenaar

unread,
May 10, 2021, 5:19:59 AM5/10/21
to vim/vim, Subscribed

It goes appear to fail consistently on FreeBSD. Perhaps it is running as root and something else?

Yegappan Lakshmanan

unread,
May 10, 2021, 11:01:52 PM5/10/21
to vim/vim, Push

@yegappan pushed 1 commit.

  • 8f363a0 Fix test failures in FreeBSD


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

Yegappan Lakshmanan

unread,
May 10, 2021, 11:02:37 PM5/10/21
to vim_dev, reply+ACY5DGGDQO7XJSUD5W...@reply.github.com, vim/vim, Subscribed
Hi Bram,

On Mon, May 10, 2021 at 2:19 AM Bram Moolenaar <vim-dev...@256bit.org> wrote:

It goes appear to fail consistently on FreeBSD. Perhaps it is running as root and something else?


The failures are caused by the 'backupskip' option. The Cirrus CI tests
are run from the /tmp directory and backups are not created for files
in the /tmp directory (because of the backupskip option).

- Yegappan 

vim-dev ML

unread,
May 10, 2021, 11:02:58 PM5/10/21
to vim/vim, vim-dev ML, Your activity

Hi Bram,

On Mon, May 10, 2021 at 2:19 AM Bram Moolenaar ***@***.***>

wrote:

> It goes appear to fail consistently on FreeBSD. Perhaps it is running as
> root and something else?
>
>
> The failures are caused by the 'backupskip' option. The Cirrus CI tests
are run from the /tmp directory and backups are not created for files
in the /tmp directory (because of the backupskip option).

- Yegappan

Yegappan Lakshmanan

unread,
May 11, 2021, 10:35:50 AM5/11/21
to vim/vim, vim-dev ML, Push

@yegappan pushed 3 commits.

  • 54c7fa6 Add additional tests for bufwrite.c
  • d17dac9 Incorporate review comments
  • bc44e43 Fix test failures in FreeBSD


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

Yegappan Lakshmanan

unread,
May 11, 2021, 10:21:35 PM5/11/21
to vim/vim, vim-dev ML, Push

@yegappan pushed 1 commit.


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

Yegappan Lakshmanan

unread,
May 12, 2021, 1:11:39 AM5/12/21
to vim/vim, vim-dev ML, Push

@yegappan pushed 1 commit.


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

Yegappan Lakshmanan

unread,
May 13, 2021, 1:44:20 AM5/13/21
to vim/vim, vim-dev ML, Push

@yegappan pushed 1 commit.


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

Bram Moolenaar

unread,
May 13, 2021, 12:33:48 PM5/13/21
to vim/vim, vim-dev ML, Comment

Closed #8192 via 36f96a5.


You are receiving this because you commented.

Reply all
Reply to author
Forward
0 new messages