mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
parsers: fix tests indentation with minidom PartialEq changes
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
e62e870ef0
commit
c8206455f1
4 changed files with 8 additions and 76 deletions
|
@ -166,37 +166,7 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn test_ex9() {
|
||||
let elem: Element = r#"
|
||||
<query xmlns='jabber:iq:register'>
|
||||
<instructions>
|
||||
Use the enclosed form to register. If your Jabber client does not
|
||||
support Data Forms, visit http://www.shakespeare.lit/contests.php
|
||||
</instructions>
|
||||
<x xmlns='jabber:x:data' type='form'>
|
||||
<title>Contest Registration</title>
|
||||
<instructions>
|
||||
Please provide the following information
|
||||
to sign up for our special contests!
|
||||
</instructions>
|
||||
<field type='hidden' var='FORM_TYPE'>
|
||||
<value>jabber:iq:register</value>
|
||||
</field>
|
||||
<field label='Given Name' var='first'>
|
||||
<required/>
|
||||
</field>
|
||||
<field label='Family Name' var='last'>
|
||||
<required/>
|
||||
</field>
|
||||
<field label='Email Address' var='email'>
|
||||
<required/>
|
||||
</field>
|
||||
<field type='list-single' label='Gender' var='x-gender'>
|
||||
<option label='Male'><value>M</value></option>
|
||||
<option label='Female'><value>F</value></option>
|
||||
</field>
|
||||
</x>
|
||||
</query>
|
||||
"#
|
||||
let elem: Element = "<query xmlns='jabber:iq:register'><instructions>Use the enclosed form to register. If your Jabber client does not support Data Forms, visit http://www.shakespeare.lit/contests.php</instructions><x xmlns='jabber:x:data' type='form'><title>Contest Registration</title><instructions>Please provide the following information to sign up for our special contests!</instructions><field type='hidden' var='FORM_TYPE'><value>jabber:iq:register</value></field><field label='Given Name' var='first'><required/></field><field label='Family Name' var='last'><required/></field><field label='Email Address' var='email'><required/></field><field type='list-single' label='Gender' var='x-gender'><option label='Male'><value>M</value></option><option label='Female'><value>F</value></option></field></x></query>"
|
||||
.parse()
|
||||
.unwrap();
|
||||
let elem1 = elem.clone();
|
||||
|
@ -211,27 +181,7 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn test_ex10() {
|
||||
let elem: Element = r#"
|
||||
<query xmlns='jabber:iq:register'>
|
||||
<x xmlns='jabber:x:data' type='submit'>
|
||||
<field type='hidden' var='FORM_TYPE'>
|
||||
<value>jabber:iq:register</value>
|
||||
</field>
|
||||
<field label='Given Name' var='first'>
|
||||
<value>Juliet</value>
|
||||
</field>
|
||||
<field label='Family Name' var='last'>
|
||||
<value>Capulet</value>
|
||||
</field>
|
||||
<field label='Email Address' var='email'>
|
||||
<value>juliet@capulet.com</value>
|
||||
</field>
|
||||
<field type='list-single' label='Gender' var='x-gender'>
|
||||
<value>F</value>
|
||||
</field>
|
||||
</x>
|
||||
</query>
|
||||
"#
|
||||
let elem: Element = "<query xmlns='jabber:iq:register'><x xmlns='jabber:x:data' type='submit'><field type='hidden' var='FORM_TYPE'><value>jabber:iq:register</value></field><field label='Given Name' var='first'><value>Juliet</value></field><field label='Family Name' var='last'><value>Capulet</value></field><field label='Email Address' var='email'><value>juliet@capulet.com</value></field><field type='list-single' label='Gender' var='x-gender'><value>F</value></field></x></query>"
|
||||
.parse()
|
||||
.unwrap();
|
||||
let elem1 = elem.clone();
|
||||
|
|
|
@ -149,12 +149,10 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn test_muc_simple_password() {
|
||||
let elem: Element = "
|
||||
<x xmlns='http://jabber.org/protocol/muc'>
|
||||
<password>coucou</password>
|
||||
</x>"
|
||||
.parse()
|
||||
.unwrap();
|
||||
let elem: Element =
|
||||
"<x xmlns='http://jabber.org/protocol/muc'><password>coucou</password></x>"
|
||||
.parse()
|
||||
.unwrap();
|
||||
let elem1 = elem.clone();
|
||||
let muc = Muc::try_from(elem).unwrap();
|
||||
assert_eq!(muc.password, Some("coucou".to_owned()));
|
||||
|
|
|
@ -383,16 +383,7 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn test_ex221_subscription() {
|
||||
let elem: Element = r#"
|
||||
<event xmlns='http://jabber.org/protocol/pubsub#event'>
|
||||
<subscription
|
||||
expiry='2006-02-28T23:59:59+00:00'
|
||||
jid='francisco@denmark.lit'
|
||||
node='princely_musings'
|
||||
subid='ba49252aaa4f5d320c24d3766f0bdcade78c78d3'
|
||||
subscription='subscribed'/>
|
||||
</event>
|
||||
"#
|
||||
let elem: Element = "<event xmlns='http://jabber.org/protocol/pubsub#event'><subscription expiry='2006-02-28T23:59:59+00:00' jid='francisco@denmark.lit' node='princely_musings' subid='ba49252aaa4f5d320c24d3766f0bdcade78c78d3' subscription='subscribed'/></event>"
|
||||
.parse()
|
||||
.unwrap();
|
||||
let event = PubSubEvent::try_from(elem.clone()).unwrap();
|
||||
|
|
|
@ -196,14 +196,7 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn test_multiple_groups() {
|
||||
let elem: Element = r#"
|
||||
<query xmlns='jabber:iq:roster'>
|
||||
<item jid='test@example.org'>
|
||||
<group>A</group>
|
||||
<group>B</group>
|
||||
</item>
|
||||
</query>
|
||||
"#
|
||||
let elem: Element = "<query xmlns='jabber:iq:roster'><item jid='test@example.org'><group>A</group><group>B</group></item></query>"
|
||||
.parse()
|
||||
.unwrap();
|
||||
let elem1 = elem.clone();
|
||||
|
|
Loading…
Reference in a new issue