mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
Support for collection subscripting (NSArray and NSDictionary).
Yes, the syntax is ugly, but no doubt people will start using it in June... git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35033 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8ffddbc573
commit
ecfd46edb2
7 changed files with 64 additions and 4 deletions
|
@ -34,6 +34,17 @@ int main()
|
|||
#endif
|
||||
obj = [obj objectAtIndex: 0];
|
||||
PASS([obj isKindOfClass: [NSMutableArray class]] == YES,"array mutable");
|
||||
START_SET("NSArray subscripting")
|
||||
# ifndef __has_feature
|
||||
# define __has_feature(x) 0
|
||||
# endif
|
||||
#if __has_feature(objc_subscripting)
|
||||
NSArray *a = @[ @"foo", @"bar" ];
|
||||
PASS([@"foo" isEqualToString:a[0]], "Array subscripting works");
|
||||
# else
|
||||
SKIP("No collection subscripting support in the compiler.")
|
||||
# endif
|
||||
END_SET("NSArray subscripting")
|
||||
[arp release]; arp = nil;
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue