Last active
December 18, 2015 01:18
-
-
Save HBehrens/5702482 to your computer and use it in GitHub Desktop.
NSSelectorFromString nor sel_getUid do return string itself
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void)testSelectorIdentity { | |
NSString* stringA = @"someSelector"; | |
NSString* stringB = stringA.mutableCopy; | |
STAssertTrue(stringA != stringB, @"strings with different identity"); | |
SEL selA = NSSelectorFromString(stringA); | |
SEL selB = NSSelectorFromString(stringB); | |
STAssertTrue(selA == selB, @"selectors with same identity (NSSelectorFromString)"); | |
selA = sel_getUid(stringA.UTF8String); | |
selB = sel_getUid(stringB.UTF8String); | |
STAssertTrue(selA == selB, @"selectors with same identity (set_getUid)"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment