just one more testcase

This commit is contained in:
Richard Frith-Macdonald 2018-02-09 08:30:08 +00:00
parent 323f9abace
commit 4aa8ca1e6d

View file

@ -2,6 +2,19 @@
#import <Foundation/NSAutoreleasePool.h>
#import <Foundation/NSString.h>
static NSString*
makeFormattedString(NSString *theFormat, ...)
{
NSString *aString;
va_list args;
va_start(args, theFormat);
aString = [[NSString alloc] initWithFormat: theFormat arguments: args];
va_end(args);
return AUTORELEASE(aString);
}
int main()
{
NSAutoreleasePool *arp = [NSAutoreleasePool new];
@ -125,6 +138,9 @@ int main()
PASS_EQUAL(s, @"€", "lossy backslassh-u20ac is a euro");
RELEASE(s);
s = makeFormattedString(@"%d.%d%s", 10, 20, "hello");
PASS_EQUAL(s, @"10.20hello", "simple intWithFormat: works");
[arp release]; arp = nil;
return 0;
}