bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: parse-duration-tests: make it build


From: Bruno Haible
Subject: Re: parse-duration-tests: make it build
Date: Thu, 21 Jun 2012 21:41:05 +0200
User-agent: KMail/4.7.4 (Linux/3.1.10-1.9-desktop; KDE/4.7.4; x86_64; ; )

Jim Meyering wrote:
> the change below, either remove the leading TABs (my preference)
> and s/-<</<</ or else you'll have to arrange not to trigger
> the leading-TAB-prohibiting syntax check rule.

It's not only about the TAB prohibiting syntax check rule. It's also
about the ease of editing for those among us who have told their
preferred editor to indent with spaces now.

Why can't you write it this way?

sed -e 's/^ *//' > "${tmpf}" <<_EOF_
  1 Y 2 M 3 W 4 d 5 h 6 m 7 s
  P 00010225 T 05:06:07
  P 1Y2M3W4D T 5H6M7S
  1 Y 2 M 25 D 5:6:7
  1 Y 2 M 25 d 5h 6:7
  1 Y 2 M 25 d 5h 6m 7
  P 1-2-25 T 5:6:7
_EOF_

Or, even better in my opinion: All the trouble has been caused my the
desire to keep a shell script and a data table in the same file. Separate
them. Move the test data into a file of its own, say
tests/test-parse-duration-data.txt. Then you don't need a temporary dir,
you don't need a 'trap' command, just a

  while read line < ${srcdir}/test-parse-duration-data.txt
  ...

command.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]