Permalink
Browse files

Add tests for pointer value matches

  • Loading branch information...
1 parent 93b92ed commit d52076d6c20d171a6a118b6a370d8c6b47452d42 Adam Sharp committed Mar 23, 2013
Showing with 16 additions and 0 deletions.
  1. +16 −0 Tests/KWEqualMatcherTest.m
View
@@ -58,6 +58,22 @@ - (void)testItShouldMatchKiwiBoxedValuesWithNumberBoxedValues {
STAssertTrue([matcher evaluate], @"expected positive match");
}
+- (void)testItShouldMatchEqualPointerValues
+{
+ int subject = 123;
+ id matcher = [KWEqualMatcher matcherWithSubject:thePointerValue(&subject)];
+ [matcher equal:thePointerValue(&subject)];
+ STAssertTrue([matcher evaluate], @"expected positive match");
+}
+
+- (void)testItShouldNotMatchUnequalPointerValues
+{
+ int subject = 123;
+ id matcher = [KWEqualMatcher matcherWithSubject:thePointerValue(&subject)];
+ [matcher equal:thePointerValue(NULL)];
+ STAssertFalse([matcher evaluate], @"expected negative match");
+}
+
- (void)testItShouldHaveHumanReadableDescription
{
id matcher = [KWEqualMatcher matcherWithSubject:theValue(123)];

0 comments on commit d52076d

Please sign in to comment.