mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +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
099038ac58
commit
3cb1b08b26
7 changed files with 64 additions and 4 deletions
|
@ -2,6 +2,7 @@
|
|||
#import "ObjectTesting.h"
|
||||
#import <Foundation/NSAutoreleasePool.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
#import <Foundation/NSString.h>
|
||||
|
||||
int main()
|
||||
|
@ -27,6 +28,19 @@ int main()
|
|||
test_NSCoding(testObjs);
|
||||
test_NSCopying(@"NSDictionary", @"NSMutableDictionary", testObjs, YES, NO);
|
||||
test_NSMutableCopying(@"NSDictionary", @"NSMutableDictionary", testObjs);
|
||||
START_SET("NSArray subscripting")
|
||||
# ifndef __has_feature
|
||||
# define __has_feature(x) 0
|
||||
# endif
|
||||
#if __has_feature(objc_subscripting)
|
||||
NSDictionary *dictionary = @{@123 : @123.4 ,
|
||||
@"date" : @"today" };
|
||||
PASS([dictionary[@123] isEqual: @123.4], "Dictionary subscripting works");
|
||||
# else
|
||||
SKIP("No dictionary subscripting support in the compiler.")
|
||||
# endif
|
||||
END_SET("NSDictionary subscripting")
|
||||
|
||||
|
||||
[arp release]; arp = nil;
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue