Skip to content

Commit

Permalink
Add a plain text man page test file & fix sed portability
Browse files Browse the repository at this point in the history
nbase wants the } after a compound command separate from the last
command.
  • Loading branch information
dfandrich committed Nov 23, 2023
1 parent 2fcc6d7 commit a0cc2e3
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Makefile-testfiles
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,10 @@ type1.vhd:
VBoxManage createmedium disk --filename=type1.vhd --format=VHD --sizebyte=163840
VBoxManage closemedium type1.vhd

type1.man: type1.1
# type1.1 is lightly-edited version of testfiles/type1.1
nroff -man -c "$^" >"$@"

# It's best to use a version of dar <= 2.7.0 to create this file to avoid test
# failures due to an archive created by a too-new version of dar.
type1.1.dar: foo
Expand Down
4 changes: 2 additions & 2 deletions autodescribe
Original file line number Diff line number Diff line change
Expand Up @@ -1053,9 +1053,9 @@ comment_man () {

# File type: mantxt (plain text version of man page)
comment_mantxt () {
COMMENT=$(sed -n -Ee '/^(N.NA.AM.ME.E|NAME)$/{N;s/^[^ ]* *//p}' < "$f" | head -1)
COMMENT=$(sed -n -Ee '/^(N.NA.AM.ME.E|NAME)$/{N;s/^[^ ]* *//p' -e '}' < "$f" | head -1)
if [ -z "$COMMENT" ] ; then
# It might be bin in roff format if it's not in plain ASCII format
# It might be in roff format if it's not in plain ASCII format
comment_man "$@"
fi
}
Expand Down
1 change: 1 addition & 0 deletions test-autodescribe-expected
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
'testfiles/type1.kra' 'Krita name'
'testfiles/type1.lsm' 'LSM Title'
'testfiles/type1.lzh' 'LZH comment in desc.sdi file'
'testfiles/type1.man' 'fileviewinfotest - plain text man page name'
'testfiles/type1.md' 'Markdown title'
'testfiles/type1.metainfo.xml' 'Nonlocalized name, Nonlocalized summary'
'testfiles/type1.mlt' 'video.mp4'
Expand Down
16 changes: 16 additions & 0 deletions testfiles/type1.man
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FILEVIEWINFOTEST(1) General Commands Manual FILEVIEWINFOTEST(1)



NNAAMMEE
fileviewinfotest - plain text man page name

SSYYNNOOPPSSIISS
ffiilleevviieewwiinnffootteesstt

DDEESSCCRRIIPPTTIIOONN
Test input file.



fileviewinfo test file 23 Nov 2023 FILEVIEWINFOTEST(1)

0 comments on commit a0cc2e3

Please sign in to comment.