Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 86b46605e4
Fetching contributors…

Cannot retrieve contributors at this time

58 lines (39 sloc) 1.089 kb
//
// WildcardTests.m
// RaptureXML
//
// Created by John Blanco on 9/24/11.
// Copyright (c) 2011 Rapture In Venice. All rights reserved.
//
#import "RXMLElement.h"
@interface WildcardTests : SenTestCase {
}
@end
@implementation WildcardTests
- (void)testEndingWildcard {
RXMLElement *rxml = [RXMLElement elementFromXMLFile:@"players.xml"];
__block NSInteger i;
// count the players and coaches
i = 0;
[rxml iterate:@"players.*" usingBlock: ^(RXMLElement *e) {
i++;
}];
STAssertEquals(i, 10, nil);
}
- (void)testMidstreamWildcard {
RXMLElement *rxml = [RXMLElement elementFromXMLFile:@"players.xml"];
__block NSInteger i;
// count the tags that have a name
i = 0;
[rxml iterate:@"players.*.name" usingBlock: ^(RXMLElement *e) {
i++;
}];
// STAssertEquals(i, 10, nil);
// count the tags that have a position
i = 0;
[rxml iterate:@"players.*.position" usingBlock: ^(RXMLElement *e) {
i++;
}];
// STAssertEquals(i, 9, nil);
}
@end
Jump to Line
Something went wrong with that request. Please try again.