On 13 Jan 2009, at 10:46 PM, Gregory Jefferis wrote:
> Hello,
>
> Thanks Christian + Mike for your recommendations + comments. I was
> able to
> convert the other tests for ComplexString + MacroResolver. Of those 2
> currently fail:
>
> - (void)testEmptyStringFromBibTeXString{
> NSString *cs = [BDSKComplexString stringWithBibTeXString:@""
> macroResolver:[self
> macroResolver] error:nil];
> STAssertNotNil(cs,nil);
> STAssertFalse([cs isComplex],nil);
> STAssertEqualObjects( (NSString *)cs,@"",nil);
> // THIS LAST ONE FAILS
> STAssertNil([(BDSKComplexString*)cs nodes],nil);
> }
>
> - (void)testWhitespaceStringFromBibTeXString{
> NSString *cs = [BDSKComplexString stringWithBibTeXString:@" "
> macroResolver:[self
> macroResolver] error:nil];
> STAssertNotNil(cs,nil);
> STAssertFalse([cs isComplex],nil);
> STAssertEqualObjects( (NSString *)cs,@"",nil);
> // THIS LAST ONE FAILS
> STAssertNil([(BDSKComplexString*)cs nodes],nil);
> }
>
> Any views? Thanks,
>
> Greg.
Yes, these tests are wrong. The -nodes accessor always returns an
NSArray. Moreover, as -nodes is now defined in an NSString category,
the typing to BDSKComplexString is unnecessary. Similarly, as a matter
of style, BDSKComplexString should not be used as a receiver for -
stringWithBibTeXString:macroResolver:.
Christiaan
------------------------------------------------------------------------------
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