On 2009-01-19 01:42, "Christiaan Hofman" <[email protected]> wrote:

> 
> On 19 Jan 2009, at 2:20 AM, Gregory Jefferis wrote:
> 
>> On 2009-01-19 00:39, "Adam R. Maxwell" <[email protected]> wrote:
>>  
> I don't think that's possible, but I don't know too much about unit
> tests. I'd rather say that the tests should be designed to be
> independent of the prefs.
Yes and no.  I think that there could be sensible reasons to want to test
the effect of a preference on program behaviour.

> That would be wrong, as there is no "right" in this case, that's why
> it fails. This particular pref is not even guaranteed to be the only
> one affecting bibtex generation. In fact, it isn't, and moreover: we
> can't know, because it may change in the future, nobody knows what the
> prefs will be.

I think my point would be that if we change code or default prefs in the
future that alters the bibtex representation then we should spot that and
either change the test or change the code/pref.  I think it is better to
start with a test that is on the fragile side and then gets refined than
with a test that is so robust that it never breaks!

> The problem  with these particular tests is that they test the wrong
> thing. They are supposed to test the string parsing, but they test as
> much the bibtex generation.

Yes you're quite right.  Thanks.

> And in that respect they make assumptions
> that are baseless, and may well be wrong (in fact, in this case they
> are wrong).

But I'm not so sure that checking the bibtex representation is a stupid
thing to do at all.  This was just a silly place to do it. Rather any test
that directly has to do with the bibtex representation would be better off
happening just once in eg TestBibItem.

> For this particular test it would be better to check the pubFields of
> the item rather than the bibtex.

Done.  But I have also put a test of bibtex minimal representation into
TestBibItem (ignoring tabs and newlines).



------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Bibdesk-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-develop

Reply via email to