URLManager?е????????????
???????????? ???????[ 2015/1/8 14:09:32 ] ?????????????????? ??????? ????????
@implementation HCIsCollectionHavingInAnyOrder
- (BOOL)matches:(id)collection describingMismatchTo:(id)
mismatchDescription
{
if (![collection conformsToProtocol:@protocol(NSFastEnumeration)])
{
[super describeMismatchOf:collection to:mismatchDescription];
return NO;
}
HCMatchingInAnyOrderEx *matchSequence =
[[HCMatchingInAnyOrderEx alloc] initWithMatchers:matchers
mismatchDescription:mismatchDescription];
for (id item in collection)
if (![matchSequence matches:item])
return NO;
return [matchSequence isFinishedWith:collection];
}
@end
id HC_hasInAnyOrder(id itemMatch?? ...)
{
NSMutableArray *matchers = [NSMutableArray arrayWithObject:HCWrapInMatcher
(itemMatch)];
va_list args;
va_start(args?? itemMatch);
itemMatch = va_arg(args?? id);
while (itemMatch != nil)
{
[matchers addObject:HCWrapInMatcher(itemMatch)];
itemMatch = va_arg(args?? id);
}
va_end(args);
return [HCIsCollectionHavingInAnyOrder isCollectionContainingInAnyOrder:matchers];
}
|
????????10??HCIsCollectionHavingInAnyOrder???
(BOOL)matches:(id)item
{
NSUInteger index = 0;
BOOL matched = (0 >= [self.matchers count]);
for (id matcher in self.matchers)
{
if ([matcher matches:item]) {
[self.matchers removeObjectAtIndex:index];
matched = YES;
return YES;
}
++index;
}
return matched;
}
|
????????11?????1???matches:????
????(void)testAddConfig
????{
????[UMNavigationController setViewControllerName:@"ViewControllerA" forURL:@"um://
????viewa2"];
????NSMutableDictionary *config = [UMNavigationController config];
????HC_assertThat([config allKeys]??
????HC_hasInAnyOrder(HC_equalTo(@"um://viewa2")?? nil));
????GHAssertEqualStrings(config[@"um://viewa2"]?? @"ViewControllerA"??
????@"config set error.");
????}
??????

???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11