mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Initial revision
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@651 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
88ad743ec3
commit
e52aeb4e27
1 changed files with 28 additions and 0 deletions
28
Testing/nsset.m
Normal file
28
Testing/nsset.m
Normal file
|
@ -0,0 +1,28 @@
|
|||
#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);
|
||||
}
|
Loading…
Reference in a new issue