summaryrefslogtreecommitdiff
path: root/tests/parse-next-stanza.el
diff options
context:
space:
mode:
Diffstat (limited to 'tests/parse-next-stanza.el')
-rw-r--r--tests/parse-next-stanza.el18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/parse-next-stanza.el b/tests/parse-next-stanza.el
new file mode 100644
index 0000000..d4f57b0
--- /dev/null
+++ b/tests/parse-next-stanza.el
@@ -0,0 +1,18 @@
+;; Tests for jabber-xml-parse-next-stanza
+
+(require 'jabber-xml)
+
+(defun parse-it (text)
+ (with-temp-buffer
+ (insert text)
+ (jabber-xml-parse-next-stanza)))
+
+(unless (equal
+ (parse-it "<presence from='foo@example.com/resource' type='unavailable' to='bar@example.com'/>")
+ '((presence ((from . "foo@example.com/resource") (type . "unavailable") (to . "bar@example.com")))))
+ (error "Testcase 1 failed"))
+
+(unless (equal
+ (parse-it "<presence from='foo@example.com/resource' ")
+ nil)
+ (error "Testcase 2 failed"))