mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
* Source/NSXMLDocument.m: add implementation of isEqual:
* Tests/base/NSXMLDocument/basic.m: add document equivalency test. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/nsxml_using_libxml2@34722 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3924b65349
commit
52c70ef9fc
3 changed files with 16 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
2012-02-04 09:23-EST Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Source/NSXMLDocument.m: add implementation of isEqual:
|
||||
* Tests/base/NSXMLDocument/basic.m: add document equivalency test.
|
||||
|
||||
2012-02-04 08:08-EST Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Source/NSXMLNode.m: minor fix in nodesForXPath:... don't
|
||||
|
|
|
@ -430,4 +430,8 @@ extern void clearPrivatePointers(xmlNodePtr aNode);
|
|||
return c;
|
||||
}
|
||||
|
||||
- (BOOL) isEqual: (id)other
|
||||
{
|
||||
return [[self rootElement] isEqual: [other rootElement]];
|
||||
}
|
||||
@end
|
||||
|
|
|
@ -8,6 +8,7 @@ int main()
|
|||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
NSArray *nodes = nil;
|
||||
NSXMLDocument *node;
|
||||
NSXMLDocument *node2;
|
||||
NSXMLElement *elem;
|
||||
NSString *documentXML =
|
||||
@"<?xml version=\"1.0\" encoding=\"utf-8\"?>"
|
||||
|
@ -85,6 +86,12 @@ int main()
|
|||
PASS([[elem name] isEqualToString: @"book"],
|
||||
"Got the correct elements from XPath query");
|
||||
|
||||
node2 = [[NSXMLDocument alloc] initWithXMLString:documentXML
|
||||
options:0
|
||||
error:NULL];
|
||||
PASS([node isEqual: node2],
|
||||
"Equal documents are equivalent");
|
||||
|
||||
[arp release];
|
||||
arp = nil;
|
||||
|
||||
|
|
Loading…
Reference in a new issue