mirror of
https://github.com/vim/vim.git
synced 2026-04-20 18:55:57 +02:00
patch 9.2.0210: tests: Test_xxd tests are failing
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>
This commit is contained in:
committed by
Christian Brabandt
parent
c9e5aeff35
commit
076404ae41
@@ -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:
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -734,6 +734,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
210,
|
||||
/**/
|
||||
209,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user