mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-26 10:11:03 +00:00
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@651 72102866-910b-0410-8b05-ffd578937521
28 lines
555 B
Objective-C
28 lines
555 B
Objective-C
#include <Foundation/NSSet.h>
|
|
#include <Foundation/NSArray.h>
|
|
#include <Foundation/NSString.h>
|
|
|
|
int
|
|
main ()
|
|
{
|
|
id a, s1, s2;
|
|
id enumerator;
|
|
|
|
a = [NSArray arrayWithObjects:
|
|
@"vache", @"poisson", @"cheval", @"poulet", nil];
|
|
|
|
s1 = [NSSet setWithArray:a];
|
|
|
|
assert ([s1 member:@"vache"]);
|
|
assert ([s1 containsObject:@"cheval"]);
|
|
assert ([s1 count] == 4);
|
|
|
|
enumerator = [s1 objectEnumerator];
|
|
while ([[enumerator nextObject] description]);
|
|
|
|
s2 = [s1 mutableCopy];
|
|
assert ([s1 isEqual:s2]);
|
|
|
|
printf("Test passed\n");
|
|
exit (0);
|
|
}
|