ObjFW  Diff

Differences From Artifact [0ba42ffac8]:

To Artifact [6153658720]:


53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77

	OFXMLElement *elem;

	elem = [OFXMLElement elementWithName: @"foo"];
	CHECK([[elem string] isEqual: @"<foo/>"]);

	[elem addAttributeWithName: @"foo"
			  andValue: @"b&ar"];
	CHECK([[elem string] isEqual: @"<foo foo='b&amp;ar'/>"])

	[elem addChild: [OFXMLElement elementWithName: @"bar"]];
	CHECK([[elem string] isEqual: @"<foo foo='b&amp;ar'><bar/></foo>"])

	elem = [OFXMLElement elementWithName: @"foo"
			      andStringValue: @"b&ar"];
	CHECK([[elem string] isEqual: @"<foo>b&amp;ar</foo>"])

	[elem addAttributeWithName: @"foo"
			  andValue: @"b&ar"];
	CHECK([[elem string] isEqual: @"<foo foo='b&amp;ar'>b&amp;ar</foo>"])

	puts("");

	return 0;
}







|






|



|






53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77

	OFXMLElement *elem;

	elem = [OFXMLElement elementWithName: @"foo"];
	CHECK([[elem string] isEqual: @"<foo/>"]);

	[elem addAttributeWithName: @"foo"
		       stringValue: @"b&ar"];
	CHECK([[elem string] isEqual: @"<foo foo='b&amp;ar'/>"])

	[elem addChild: [OFXMLElement elementWithName: @"bar"]];
	CHECK([[elem string] isEqual: @"<foo foo='b&amp;ar'><bar/></foo>"])

	elem = [OFXMLElement elementWithName: @"foo"
				 stringValue: @"b&ar"];
	CHECK([[elem string] isEqual: @"<foo>b&amp;ar</foo>"])

	[elem addAttributeWithName: @"foo"
		       stringValue: @"b&ar"];
	CHECK([[elem string] isEqual: @"<foo foo='b&amp;ar'>b&amp;ar</foo>"])

	puts("");

	return 0;
}