[darcs-users] darcs patch: tests/*: refactor remaining IFS calls to lib

Trent W. Buck trentbuck at gmail.com
Tue Dec 2 23:46:37 UTC 2008


Eric Kow <kowey at darcs.net> writes:

> Ah, I was just about to write you to report that tests are still passing
> after your first patch.
>
> But are you sure this is a good idea, below, to effectively make /every/
> test set IFS=''?
>
> The bash manpage says:
>
> IFS    The Internal Field Separator that is  used  for  word  splitting
>        after  expansion  and  to  split  lines into words with the read
>        builtin  command.   The  default  value  is  ‘‘<space><tab><new‐
>        line>’’.
>
> I confess that I still don't fully understand the consquences of this.
> One thing I'm worried about is breaking other non-IFS-y tests.  Another
> deeper worry is that we start (unknowingly) writing tests that depend
> on this behaviour.

In general, setting IFS can lead to hairy and confusing bugs, and so I'd
advocate leaving it visible.  But I haven't looked at the tests, so I
don't know why IFS is being set -- it might be that many of the tests
that currently set IFS don't need to; someone just blindly copied the
line from an older test.



More information about the darcs-users mailing list