source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Fully skip first and last line for the purpose of cmp.
@ 2010-05-16 18:10 kristaps
  0 siblings, 0 replies; only message in thread
From: kristaps @ 2010-05-16 18:10 UTC (permalink / raw)
  To: source

Log Message:
-----------
Fully skip first and last line for the purpose of cmp.

Modified Files:
--------------
    mdocml/regress:
        regress.sh

Revision Data
-------------
Index: regress.sh
===================================================================
RCS file: /home/joerg/cvsroot/mdocml/regress/regress.sh,v
retrieving revision 1.4
retrieving revision 1.5
diff -Lregress/regress.sh -Lregress/regress.sh -u -p -r1.4 -r1.5
--- regress/regress.sh
+++ regress/regress.sh
@@ -23,9 +23,11 @@ for file in */*.in */*/*.in; do
 	printf "%s: " "$file"
 	${MANDOC} "$file" > test.mandoc 2> /dev/null
 	${NROFF} ${OUTPUT} -mandoc "$file" > test.nroff 2> /dev/null
-	mandoclen=`head -n 1 test.mandoc | wc -c`
-	nrofflen=`head -n 1 test.nroff | wc -c`
-	if cmp -s test.mandoc test.nroff $mandoclen $nrofflen; then
+	l=`wc -l < test.mandoc`
+	head -n `expr $l - 1` test.mandoc | tail -n `expr $l - 2` > test.mandoc_
+	l=`wc -l < test.nroff`
+	head -n `expr $l - 1` test.nroff| tail -n `expr $l - 2` > test.nroff_
+	if cmp -s test.mandoc_ test.nroff_; then
 		rm -f test.mandoc test.nroff
 		echo "passed"
 		pass=`expr $pass + 1`
@@ -39,4 +41,5 @@ for file in */*.in */*/*.in; do
 		diff -u "${file2}".nroff "${file2}".mandoc > "${file2}".diff
 	fi
 done
+rm -f test.mandoc_ test.nroff_
 echo "Total: $pass passed, $failed failed"
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-05-16 18:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-16 18:10 mdocml: Fully skip first and last line for the purpose of cmp kristaps

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).