tests: Add test for scansion:any

Tue, 10 Jul 2018 11:14:34 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Tue, 10 Jul 2018 11:14:34 +0100
changeset 95
a1e7ad9336db
parent 94
1b3e848b4394
child 96
de4dcef0b0f0

tests: Add test for scansion:any

spec/stanzacmp_spec.lua file | annotate | diff | comparison | revisions
--- a/spec/stanzacmp_spec.lua	Tue Jul 10 11:09:56 2018 +0100
+++ b/spec/stanzacmp_spec.lua	Tue Jul 10 11:14:34 2018 +0100
@@ -61,4 +61,35 @@
 		s1:tag("c", { n = "1" });
 		no(s1, s2);
 	end);
+	it("should allow matching any attribute value with {scansion:any}", function ()
+		--[[
+		<message from="user@localhost/71652fc8-93cb-40c7-8220-47ce80cc417b" type="chat">
+  		<body>Hello Juliet, are you there?</body>
+  		<delay xmlns="urn:xmpp:delay" from="localhost"/>
+		</message>
+		]]
+		
+		local s01 = st.message({ from = "user@localhost/71652fc8-93cb-40c7-8220-47ce80cc417b", type = "chat" })
+			:tag("body"):text("Hello Juliet, are you there?"):up()
+			:tag("delay", { xmlns = "urn:xmpp:delay", from = "localhost", stamp = "{scansion:any}" }):up();
+		
+		--[[
+		<message to="juliet@localhost" type="chat" from="user@localhost/71652fc8-93cb-40c7-8220-47ce80cc417b">
+  		<body>Hello Juliet, are you there?</body>
+  		<stanza-id xmlns="urn:xmpp:sid:0" by="user@localhost" id="eb9eaf13-384e-47d1-a6c0-303ef4f1ac70"/>
+  		<stanza-id xmlns="urn:xmpp:sid:0" by="juliet@localhost" id="f6c6f61d-0b15-46d6-9f69-bca1640401d1"/>
+  		<delay xmlns="urn:xmpp:delay" stamp="2017-05-07T09:46:21Z" from="localhost"/>
+		</message>
+		]]
+		
+		local s02 = st.message({ to = "juliet@localhost", from = "user@localhost/71652fc8-93cb-40c7-8220-47ce80cc417b", type = "chat" })
+			:tag("body"):text("Hello Juliet, are you there?"):up()
+			:tag("stanza-id", { xmlns = "urn:xmpp:sid:0", by = "user@localhost", id = "eb9eaf13-384e-47d1-a6c0-303ef4f1ac70" }):up()
+			:tag("stanza-id", { xmlns = "urn:xmpp:sid:0", by = "juliet@localhost", id = "f6c6f61d-0b15-46d6-9f69-bca1640401d1" }):up()
+			:tag("delay", { xmlns = "urn:xmpp:delay", stamp = "2017-05-07T09:46:21Z", from = "localhost" }):up();
+		
+		
+		
+		yes(s01, s02);
+	end);
 end);

mercurial