]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0210: tests: Test_xxd tests are failing v9.2.0210
authorMuraoka Taro <koron.kaoriya@gmail.com>
Fri, 20 Mar 2026 21:19:03 +0000 (21:19 +0000)
committerChristian Brabandt <cb@256bit.org>
Fri, 20 Mar 2026 21:19:03 +0000 (21:19 +0000)
Problem:  tests: Test_xxd tests are failing, after changing the xxd
          manpage (after v9.2.0205)
Solution: Update the manpage, shorten the date and update the example,
          regenerate the expected test output, skip the first 30 bytes
          for the one of the xxd tests (Muraoka Taro)

Some of the Test_xxd tests depend on the contents of xxd.1. The patch
9.2.0205 changed xxd.1, but the test fixes were insufficient. The test
that dumps the beginning of xxd.1 and the test that reads 13 bytes
starting from byte 0x33 from the beginning were failing.

closes: #19763

Co-authored-by: James McCoy <jamessan@debian.org>
Signed-off-by: Muraoka Taro <koron.kaoriya@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/doc/xxd.1
runtime/doc/xxd.man
src/testdir/test_xxd.vim
src/version.c

index e81d8cdee29da8a6315f1f403bf2e67763d1c1c8..ce6b24daec4585e99d19b021d29500ea44ee52a1 100644 (file)
@@ -1,4 +1,4 @@
-.TH XXD 1 "March 2026" "Manual page for xxd"
+.TH XXD 1 "Mar 2026" "Manual page for xxd"
 .\"
 .\" 21st May 1996
 .\" Man page author:
@@ -368,17 +368,17 @@ Read single characters from a serial line
 .PP
 Output in C style include output with terminating zero
 .br
-\fI% echo -e \&"0123456789\&" > digits\fR
+\fI% echo -n \&"0123456789\&" > digits\fR
 .br
 \fI% xxd -i -t digits\fR
 .br
 unsigned char digits[] = {
 .br
-  0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x0a, 0x00
+  0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x00
 .br
 };
 .br
-unsigned int digits_len = 11;
+unsigned int digits_len = 10;
 .PP
 .SH "RETURN VALUES"
 The following error values are returned:
index e5c677ec5fb09140046fdaf9c4f702fff1cac2d7..7fe6bca0cf15e1eb0721fd72657a3d16d3354fb0 100644 (file)
@@ -250,13 +250,12 @@ EXAMPLES
        % echo -n foo > /dev/term/b
 
        Output in C style include output with terminating zero
-       % echo -e "0123456789" > digits
+       % echo -n "0123456789" > digits
        % xxd -i -t digits
        unsigned char digits[] = {
-         0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36,  0x37,  0x38,  0x39,  0x0a,
-       0x00
+         0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x00
        };
-       unsigned int digits_len = 11;
+       unsigned int digits_len = 10;
 
 RETURN VALUES
        The following error values are returned:
@@ -295,4 +294,4 @@ AUTHOR
        <tony@sctnugen.ppp.gu.edu.au> <T.Nugent@sct.gu.edu.au>
        Small changes by Bram Moolenaar.  Edited by Juergen Weigert.
 
-Manual page for xxd               March 2026                            XXD(1)
+Manual page for xxd                Mar 2026                             XXD(1)
index 75dbd8bf69427cd219b38649ac79a36c0a3e1a14..d460315f7a4d3249f41d9f405da53d245c97d506 100644 (file)
@@ -67,17 +67,19 @@ func Test_xxd()
   exe '0r ' man_page '| set ff=unix | $d | w' man_copy '| bwipe!' man_copy
 
   " Test 5: Print 120 bytes as continuous hexdump with 20 octets per line
+  "         skip the first 30 bytes, it contains the date of the manpage
+  "         which can change
   let s:test += 1
   %d
-  exe '0r! ' . s:xxd_cmd . ' -l 120 -ps -c20 ' . man_copy
+  exe '0r! ' . s:xxd_cmd . ' -s 30 -l 120 -ps -c20 ' . man_copy
   $d
   let expected = [
-      \ '2e544820585844203120224d6179203230323422',
-      \ '20224d616e75616c207061676520666f72207878',
-      \ '64220a2e5c220a2e5c222032317374204d617920',
-      \ '313939360a2e5c22204d616e2070616765206175',
-      \ '74686f723a0a2e5c2220202020546f6e79204e75',
-      \ '67656e74203c746f6e79407363746e7567656e2e']
+      \ '61676520666f7220787864220a2e5c220a2e5c22',
+      \ '2032317374204d617920313939360a2e5c22204d',
+      \ '616e207061676520617574686f723a0a2e5c2220',
+      \ '202020546f6e79204e7567656e74203c746f6e79',
+      \ '407363746e7567656e2e7070702e67752e656475',
+      \ '2e61753e203c542e4e7567656e74407363742e67']
   call assert_equal(expected, getline(1,'$'), s:Mess(s:test))
 
   " Test 6: Print the date from xxd.1
index 820096693416a9ca5720706a56348e27ab8ea0a0..d95613190587dc9baefcc5cb7f1d728d1ac7142e 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    210,
 /**/
     209,
 /**/