Tom wrote:
> On Friday, January 25, 2019 at 9:52:39 PM UTC+1, Bram Moolenaar wrote:
> > Patch 8.1.0821
> > Problem: Xxd "usage" output and other arguments not tested.
> > Solution: Add a test to trigger the usage output in various ways. Fix
> > uncovered problem.
> > Files: src/testdir/test_xxd.vim, src/xxd/xxd.c
> >
>
> [...]
>
> > ***************
> > *** 69,78 ****
> >
> > " Test 6: Print the date from xxd.1
> > let s:test += 1
> > ! %d
> > ! exe '0r! ' . s:xxd_cmd . ' -s 0x36 -l 13 -c 13 ' . fname
> > ! $d
> > ! call assert_equal('00000036: 3231 7374 204d 6179 2031 3939 36 21st May
> > 1996', getline(1), s:Mess(s:test))
> >
> > " Test 7: Print C include
> > let s:test += 1
> > --- 73,84 ----
> >
> > " Test 6: Print the date from xxd.1
> > let s:test += 1
> > ! for arg in ['-l 13', '-l13', '-len 13']
> > ! %d
> > ! exe '0r! ' . s:xxd_cmd . ' -s 0x36 -l 13 -cols 13 ' . fname
>
> Arg was meant to be passed to xxd in this line, wasn't it? Like this:
>
> exe '0r! ' . s:xxd_cmd . ' -s 0x36 ' . arg . ' -cols 13 ' . fname
Right, I'll fix that.
> > --- src/xxd/xxd.c 2019-01-25 21:46:21.129278533 +0100
> > ***************
> > *** 508,517 ****
> > }
> > else if (!STRNCMP(pp, "-c", 2))
> > {
> > ! if (pp[2] && STRNCMP("ols", pp + 2, 3))
> > ! cols = (int)strtol(pp + 2, NULL, 0);
> > ! else if (pp[2] && STRNCMP("apitalize", pp + 2, 9))
> > capitalize = 1;
> > else
> > {
> > if (!argv[2])
> > --- 508,517 ----
> > }
> > else if (!STRNCMP(pp, "-c", 2))
> > {
> > ! if (pp[2] && !STRNCMP("apitalize", pp + 2, 9))
> > capitalize = 1;
> > + else if (pp[2] && STRNCMP("ols", pp + 2, 3))
>
> Isn't there an exclamation mark before "STRNCMP" missing in this line?
> The test for "capitalize" two lines up does contain one.
It's the other way around: "-cols NR" or "-cNR", this is testing that pp
+ 2 does NOT match "cols" after "-c", the number follows "-c" directly
in the same argument.
> > + cols = (int)strtol(pp + 2, NULL, 0);
> > else
> > {
> > if (!argv[2])
> > ***************
> > *** 523,529 ****
> > }
> > else if (!STRNCMP(pp, "-g", 2))
> > {
> > ! if (pp[2] && STRNCMP("group", pp + 2, 5))
> > octspergrp = (int)strtol(pp + 2, NULL, 0);
> > else
> > {
> > --- 523,529 ----
> > }
> > else if (!STRNCMP(pp, "-g", 2))
> > {
> > ! if (pp[2] && STRNCMP("roup", pp + 2, 4))
>
> Exclamation mark missing again?
Same thing.
--
Q: How does a UNIX Guru do Sex ?
A: unzip;strip;touch;finger;mount;fsck;more;yes;umount;sleep
/// Bram Moolenaar -- [email protected] -- 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 ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.