[darcs-users] darcs patch: tests/*: refactor remaining IFS calls to lib
Gwern Branwen
gwern0 at gmail.com
Wed Dec 3 00:39:47 UTC 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
On Tue, Dec 2, 2008 at 6:46 PM, Trent W. Buck wrote:
> Eric Kow 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 ''> 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.
No, fortunately that's not the case. My first patch removed IFS from
all of them. This caused the tests which did in fact need IFS to fail.
My second patch did it again, but spared the failing tests - which
still removed the IFS stuff from a fair number of tests. So all the
remaining calls to IFS need it somehow.
- --
gwern
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEAREKAAYFAkk11SoACgkQvpDo5Pfl1oKMaACdEs3Gd9gf9PgiRdpTfmmACHc0
CCYAoI99nrMxglGzxClvqGL1gOb0uve7
=d4HM
-----END PGP SIGNATURE-----
More information about the darcs-users
mailing list