File: test-binding-macro.lisp

package info (click to toggle)
cl-irc 1%3A0.8.1-dfsg-3.1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, squeeze, wheezy
  • size: 3,080 kB
  • ctags: 579
  • sloc: lisp: 4,074; makefile: 46
file content (56 lines) | stat: -rw-r--r-- 1,591 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
;;;; $Id: test-binding-macro.lisp 161 2006-05-23 20:40:48Z ehuelsmann $
;;;; $URL: svn+ssh://ehuelsmann@common-lisp.net/project/cl-irc/svn/trunk/test/test-binding-macro.lisp $

;;;; See the LICENSE file for licensing information.


(in-package :cl-irc-test)

(defvar *protocol-mode*
  ":Chanserv!chanserve@services. MODE #svn +o eh")


;; tests which should complete successfully

(deftest binding.1
  (destructuring-arguments
       (target modes &rest arguments)
       (cl-irc::create-irc-message *protocol-mode*)
     (values target modes arguments))
  "#svn" "+o" ("eh"))


(deftest binding.2
  (destructuring-arguments
       (target :ignored &rest arguments)
       (cl-irc::create-irc-message *protocol-mode*)
     (values target arguments))
  "#svn" ("eh"))

(deftest binding.3
  (destructuring-arguments
       (:ignored &rest arguments &req nick)
       (cl-irc::create-irc-message *protocol-mode*)
     (values nick arguments))
  "eh" ("+o"))

(deftest binding.4
  (destructuring-arguments
       (target &optional modes &req nick)
       (cl-irc::create-irc-message *protocol-mode*)
     (values target modes nick))
  "#svn" "+o" "eh")

(deftest binding.5
  (destructuring-arguments
       (&whole all target &optional modes &req nick)
       (cl-irc::create-irc-message *protocol-mode*)
     (values all target modes nick))
  ("#svn" "+o" "eh") "#svn" "+o" "eh")

(deftest binding.6
  (destructuring-arguments
       (target &optional modes &rest args &req nick)
       (cl-irc::create-irc-message *protocol-mode*)
     (values target modes args nick))
  "#svn" "+o" nil "eh")