spec/stanzacmp_spec.lua

changeset 95
a1e7ad9336db
parent 93
3f9bda0887d5
child 98
88a3e03f4b9f
equal deleted inserted replaced
94:1b3e848b4394 95:a1e7ad9336db
59 s1:tag("b"); 59 s1:tag("b");
60 yes(s1, s2); 60 yes(s1, s2);
61 s1:tag("c", { n = "1" }); 61 s1:tag("c", { n = "1" });
62 no(s1, s2); 62 no(s1, s2);
63 end); 63 end);
64 it("should allow matching any attribute value with {scansion:any}", function ()
65 --[[
66 <message from="user@localhost/71652fc8-93cb-40c7-8220-47ce80cc417b" type="chat">
67 <body>Hello Juliet, are you there?</body>
68 <delay xmlns="urn:xmpp:delay" from="localhost"/>
69 </message>
70 ]]
71
72 local s01 = st.message({ from = "user@localhost/71652fc8-93cb-40c7-8220-47ce80cc417b", type = "chat" })
73 :tag("body"):text("Hello Juliet, are you there?"):up()
74 :tag("delay", { xmlns = "urn:xmpp:delay", from = "localhost", stamp = "{scansion:any}" }):up();
75
76 --[[
77 <message to="juliet@localhost" type="chat" from="user@localhost/71652fc8-93cb-40c7-8220-47ce80cc417b">
78 <body>Hello Juliet, are you there?</body>
79 <stanza-id xmlns="urn:xmpp:sid:0" by="user@localhost" id="eb9eaf13-384e-47d1-a6c0-303ef4f1ac70"/>
80 <stanza-id xmlns="urn:xmpp:sid:0" by="juliet@localhost" id="f6c6f61d-0b15-46d6-9f69-bca1640401d1"/>
81 <delay xmlns="urn:xmpp:delay" stamp="2017-05-07T09:46:21Z" from="localhost"/>
82 </message>
83 ]]
84
85 local s02 = st.message({ to = "juliet@localhost", from = "user@localhost/71652fc8-93cb-40c7-8220-47ce80cc417b", type = "chat" })
86 :tag("body"):text("Hello Juliet, are you there?"):up()
87 :tag("stanza-id", { xmlns = "urn:xmpp:sid:0", by = "user@localhost", id = "eb9eaf13-384e-47d1-a6c0-303ef4f1ac70" }):up()
88 :tag("stanza-id", { xmlns = "urn:xmpp:sid:0", by = "juliet@localhost", id = "f6c6f61d-0b15-46d6-9f69-bca1640401d1" }):up()
89 :tag("delay", { xmlns = "urn:xmpp:delay", stamp = "2017-05-07T09:46:21Z", from = "localhost" }):up();
90
91
92
93 yes(s01, s02);
94 end);
64 end); 95 end);

mercurial