LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File Net-Jabber-2.0-tests.diff of Package perl-Net-Jabber (Project openSUSE:12.1)

Index: t/protocol_rpc.t
===================================================================
--- t/protocol_rpc.t.orig
+++ t/protocol_rpc.t
@@ -16,7 +16,12 @@ ok( defined($query1), "new()" );
 isa_ok( $query1, "Net::Jabber::Stanza" );
 isa_ok( $query1, "Net::XMPP::Stanza" );
 
-is( $query1->GetXML(), "<query xmlns='jabber:iq:rpc'><methodCall><methodName>test_call</methodName><params><param><value><string>foo</string></value></param><param><value><i4>4</i4></value></param><param><value><struct><member><name>a</name><value><i4>1</i4></value></member><member><name>b</name><value><string>bar</string></value></member></struct></value></param></params></methodCall></query>", "GetXML()" );
+my $o = "<query xmlns='jabber:iq:rpc'><methodCall><methodName>test_call</methodName><params><param><value><string>foo</string></value></param><param><value><i4>4</i4></value></param><param><value><struct>";
+my $a = "<member><name>a</name><value><i4>1</i4></value></member>";
+my $b = "<member><name>b</name><value><string>bar</string></value></member>";
+my $c = "</struct></value></param></params></methodCall></query>";
+my $r = $query1->GetXML();
+ok(($r eq "$o$a$b$c") || ($r eq "$o$b$a$c"), "GetXML()" );
 
 
 my $query2 = $client->RPCEncode(type=>"methodResponse",
@@ -37,7 +42,10 @@ ok( defined($query3), "new()" );
 isa_ok( $query3, "Net::Jabber::Stanza" );
 isa_ok( $query3, "Net::XMPP::Stanza" );
 
-is( $query3->GetXML(), "<query xmlns='jabber:iq:rpc'><methodResponse><params><param><value><string>foo</string></value></param><param><value><i4>4</i4></value></param><param><value><struct><member><name>a</name><value><i4>1</i4></value></member><member><name>b</name><value><string>bar</string></value></member></struct></value></param><param><value><array><data><value><string>a</string></value></data><data><value><i4>1</i4></value></data><data><value><string>foo</string></value></data></array></value></param></params></methodResponse></query>", "GetXML()" );
+my $o2 = "<query xmlns='jabber:iq:rpc'><methodResponse><params><param><value><string>foo</string></value></param><param><value><i4>4</i4></value></param><param><value><struct>";
+my $c2 = "</struct></value></param><param><value><array><data><value><string>a</string></value></data><data><value><i4>1</i4></value></data><data><value><string>foo</string></value></data></array></value></param></params></methodResponse></query>";
+my $r2 = $query3->GetXML();
+ok(($r2 eq "$o2$a$b$c2") || ($r2 eq "$o2$b$a$c2"), "GetXML()" );
 
 
 my $query4 = $client->RPCEncode(type=>"methodResponse",