This commit was manufactured by cvs2svn to create branch 'elmo-imap4-new-
[elisp/wanderlust.git] / tests / test-wl-util.el
1 ;; -*- lexical-binding: t -*-
2 (require 'lunit)
3 (require 'wl-util)
4
5 (luna-define-class test-wl-util (lunit-test-case))
6
7 (luna-define-method test-wl-parse-addresses-1 ((case test-wl-util))
8   (lunit-assert
9    (equal
10     '("foo@example.com" "bar@example.com")
11     (wl-parse-addresses "foo@example.com, bar@example.com"))))
12
13
14 ;; Message-ID
15 (luna-define-method test-wl-unique-id ((case test-wl-util))
16   (lunit-assert
17    (not
18     (string= (wl-unique-id)
19              (progn (sleep-for 1) (wl-unique-id))))))
20
21 (luna-define-method test-wl-unique-id-by-user ((case test-wl-util))
22   (lunit-assert
23    (let (user-login-name)
24      (not
25       (string= (progn (setq user-login-name "_alice") (wl-unique-id))
26                (progn (setq user-login-name "_bob") (wl-unique-id)))))))
27
28
29 (luna-define-method test-wl-inverse-alist ((case test-wl-util))
30   (lunit-assert
31    (equal
32     '((cc c) (aa a))
33     (wl-inverse-alist '(a c) '((a . aa) (a . bb) (c . cc))))))