Skip to content

conformsToProtocol switch #21

Merged
merged 3 commits into from Oct 6, 2012

2 participants

@aspitz
aspitz commented Oct 4, 2012

I switched CPGrammar 'conformsToProtocol' test from 'class_conformsToProtocol' to NSObjects 'conformsToProtocol' (line 77). NSObjects 'conformsToProtocol' actually takes the class hierarchy into account where 'class_conformsToProtocol' does not. This means that I can create a hierarchy of class where a root object implements the CPParseResults and any of it's children will pass the 'conformsToProtocol' test.

@aspitz aspitz Switched CPGrammar 'conformsToProtocol' test from 'class_conformsToPr…
…otocol' to NSObjects 'conformsToProtocol'. NSObjects 'conformsToProtocol' actually takes the class hierarchy into account where 'class_conformsToProtocol' does not.
859ce82
@beelsebob
Owner

Looks like a very sane patch. This was always the intended behaviour here, so I had a bug, and a rule that if I have a bug, that I have a test case to check it after it's removed. Could you add a quick test case to the test suite, and I'll pull it in straight away :)

aspitz added some commits Oct 4, 2012
@aspitz aspitz Added a unit test to determine if 'conformToProtocol' was properly id…
…entifying a class conforming to a protocol via inheritance
4863025
@aspitz aspitz Added a unit test to determine if 'conformToProtocol' was properly id…
…entifying a class conforming to a protocol via inheritance
376212f
@aspitz
aspitz commented Oct 5, 2012

Added the unit test you asked for

@beelsebob beelsebob merged commit 527833b into beelsebob:master Oct 6, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.