34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
TEST(@"+[elementWithName:stringValue:]",
(elem[1] = [OFXMLElement elementWithName: @"foo"
stringValue: @"b&ar"]) &&
[[elem[1] string] isEqual: @"<foo>b&ar</foo>"])
TEST(@"-[addAttributeWithName:stringValue:]",
[elem[0] addAttributeWithName: @"foo"
stringValue: @"b&ar"] &&
[[elem[0] string] isEqual: @"<foo foo='b&ar'/>"] &&
[elem[1] addAttributeWithName: @"foo"
stringValue: @"b&ar"] &&
[[elem[1] string] isEqual: @"<foo foo='b&ar'>b&ar</foo>"])
TEST(@"-[addChild:]",
[elem[0] addChild: [OFXMLElement elementWithName: @"bar"]] &&
[[elem[0] string] isEqual: @"<foo foo='b&ar'><bar/></foo>"])
[pool drain];
}
@end
|
|
|
|
|
|
|
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
TEST(@"+[elementWithName:stringValue:]",
(elem[1] = [OFXMLElement elementWithName: @"foo"
stringValue: @"b&ar"]) &&
[[elem[1] string] isEqual: @"<foo>b&ar</foo>"])
TEST(@"-[addAttributeWithName:stringValue:]",
R([elem[0] addAttributeWithName: @"foo"
stringValue: @"b&ar"]) &&
[[elem[0] string] isEqual: @"<foo foo='b&ar'/>"] &&
R([elem[1] addAttributeWithName: @"foo"
stringValue: @"b&ar"]) &&
[[elem[1] string] isEqual: @"<foo foo='b&ar'>b&ar</foo>"])
TEST(@"-[addChild:]",
R([elem[0] addChild: [OFXMLElement elementWithName: @"bar"]]) &&
[[elem[0] string] isEqual: @"<foo foo='b&ar'><bar/></foo>"])
[pool drain];
}
@end
|