File: parse-next-stanza.el

package info (click to toggle)
emacs-jabber 0.8.92%2Bgit98dc8e-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,036 kB
  • ctags: 992
  • sloc: lisp: 12,234; makefile: 71; sh: 1
file content (18 lines) | stat: -rw-r--r-- 525 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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"))