Question on test_increment_dbcs.vim

8 views
Skip to first unread message

Brian L. Matthews

unread,
Apr 15, 2020, 3:39:41 AM4/15/20
to vim...@googlegroups.com
I'm trying to get vim to compile on my Mac running Mojave and it's
failing. I've grabbed the latest sources:

$ git reset --hard origin/master
HEAD is now at 4d5d0dfe9 patch 8.2.0579: Coverity warns for unused value

My configure command is:

./configure --disable-gui --enable-largefile --enable-multibyte
--enable-pythoninterp --prefix=/usr/local

make succeeds then make test results in:

Executed:  2870 Tests
 Skipped:    33 Tests
  FAILED:     1 Tests


Failures:
    From test_increment_dbcs.vim:
    Found errors in Test_increment_dbcs_1():
    function RunTheTest[39]..Test_increment_dbcs_1 line 4: Expected
['?R2'] but got ['?S1']
    function RunTheTest[39]..Test_increment_dbcs_1 line 5: Expected [0,
1, 3, 0] but got [0, 1, 2, 0]
    function RunTheTest[39]..Test_increment_dbcs_1 line 9: Expected
['?`?a?b0xDD?e'] but got ['?`?a?b0xDE?e']
    function RunTheTest[39]..Test_increment_dbcs_1 line 10: Expected
[0, 1, 10, 0] but got [0, 1, 4, 0]

TEST FAILURE
make[2]: *** [report] Error 1
make[1]: *** [scripttests] Error 2
make: *** [test] Error 2

After studying test_increment_dbcs.vim, it appears it's failing because
the vim under test isn't recognizing <8e> as "shifting" the next
character, so in <8e>R1, CTRL-A is incrementing the R (alpha has been
added to nrformats) as if it's just a regular alphabetical character,
instead of the 1 (and similarly for the CTRL-X test later in the file),
while it shouldn't be treating R as alphabetical because the encoding
has been set to cp932 and it's preceeded by an <8e>.

If I modify the test so it doesn't added alpha to nrformats, it works,
but for the wrong reason (I think). Does anyone have any idea why it
might be doing this? For now I've just ignored the failure because it's
the only one and it's not something I'll ever use (until after I've
forgotten I've ignored it not working :-) ), but I'd like all the tests
to actually succeed.

Thanks,
Brian

Bram Moolenaar

unread,
Apr 15, 2020, 3:06:17 PM4/15/20
to vim...@googlegroups.com, Brian L. Matthews
The test sets 'encoding' to "cp932". When you do that, do you get a
warning or error? Vim uses mblen() to decide which bytes start a
double-byte character, perhaps that doesn't work in your case.

We could skip the test if cp932 doesn't work, but we need to detect that
somehow. Perhaps check with strchars()? Can you do this:
:set enc=cp932
:echo strlen("\x8eR")
:echo strchars("\x8eR")

--
Hanson's Treatment of Time:
There are never enough hours in a day, but always too
many days before Saturday.

/// 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