Update of /project/net-nittin-irc/cvsroot/net-nittin-irc/test In directory common-lisp.net:/tmp/cvs-serv25077
Modified Files: test-parse-message.lisp Log Message: adding more tests
Date: Sun Nov 23 18:06:24 2003 Author: eenge
Index: net-nittin-irc/test/test-parse-message.lisp diff -u net-nittin-irc/test/test-parse-message.lisp:1.1 net-nittin-irc/test/test-parse-message.lisp:1.2 --- net-nittin-irc/test/test-parse-message.lisp:1.1 Sun Nov 23 17:40:23 2003 +++ net-nittin-irc/test/test-parse-message.lisp Sun Nov 23 18:06:24 2003 @@ -1,11 +1,46 @@ -;;;; $Id: test-parse-message.lisp,v 1.1 2003/11/23 22:40:23 eenge Exp $ +;;;; $Id: test-parse-message.lisp,v 1.2 2003/11/23 23:06:24 eenge Exp $ ;;;; $Source: /project/net-nittin-irc/cvsroot/net-nittin-irc/test/test-parse-message.lisp,v $
;;;; See the LICENSE file for licensing information.
(in-package :net-nittin-irc-test)
+(defvar *msg1* (format nil ":kire!~~eenge@216.248.178.227 PRIVMSG cl-irc :heyhey!~A" #\Return)) +(defvar *msg2* (format nil ":tolkien.freenode.net 372 cl-irc :-~A" #\Return)) +(defvar *msg3* (format nil "NOTICE AUTH :*** Your forward and reverse DNS don't match~A" #\return)) + (deftest find-reply-name.1 (irc:find-reply-name 1) :rpl_welcome) (deftest find-reply-name.2 (handler-bind ((irc:no-such-reply #'continue)) (irc:find-reply-name 999)) :unknown-reply) + +(deftest return-source.1 (irc::return-source #.*msg1*) 5 "kire") +(deftest return-source.2 (irc::return-source #.*msg2*) 21 "tolkien.freenode.net") +(deftest return-source.3 (irc::return-source #.*msg3*) 0 nil) + +(deftest return-user.1 (irc::return-user #.*msg1* :start 5) 12 "~eenge") +(deftest return-user.2 (irc::return-user #.*msg2* :start 21) 21 nil) +(deftest return-user.3 (irc::return-user #.*msg3* :start 0) 0 nil) + +(deftest return-host.1 (irc::return-host #.*msg1* :start 12) 28 "216.248.178.227") +(deftest return-host.2 (irc::return-host #.*msg2* :start 21) 21 nil) +(deftest return-host.3 (irc::return-host #.*msg3* :start 0) 0 nil) + +(deftest return-command.1 (irc::return-command #.*msg1* :start 28) 36 "PRIVMSG") +(deftest return-command.2 (irc::return-command #.*msg2* :start 21) 25 "372") +(deftest return-command.3 (irc::return-command #.*msg3* :start 0) 6 "NOTICE") + +(deftest return-arguments.1 (irc::return-arguments #.*msg1* :start 36) 44 ("cl-irc")) +(deftest return-arguments.2 (irc::return-arguments #.*msg2* :start 25) 33 ("cl-irc")) +(deftest return-arguments.3 (irc::return-arguments #.*msg3* :start 6) 12 ("AUTH")) + +(deftest return-trailing-argument.1 + (irc::return-trailing-argument #.*msg1* :start 44) 52 "heyhey!") +(deftest return-trailing-argument.2 + (irc::return-trailing-argument #.*msg2* :start 33) 35 "-") +(deftest return-trailing-argument.3 + (irc::return-trailing-argument #.*msg3* :start 12) 57 "*** Your forward and reverse DNS don't match") + +(deftest parse-raw-message.1 + (irc::parse-raw-message #.*msg1*) + "kire" "~eenge" "216.248.178.227" "PRIVMSG" ("cl-irc") "heyhey!")