Update of /project/net-nittin-irc/cvsroot/net-nittin-irc/test In directory common-lisp.net:/tmp/cvs-serv13545
Modified Files: test-parse-message.lisp Log Message: adding more tests to capture MODE messages and correct argument parsing
Date: Mon Nov 24 22:10:52 2003 Author: eenge
Index: net-nittin-irc/test/test-parse-message.lisp diff -u net-nittin-irc/test/test-parse-message.lisp:1.3 net-nittin-irc/test/test-parse-message.lisp:1.4 --- net-nittin-irc/test/test-parse-message.lisp:1.3 Sun Nov 23 18:35:30 2003 +++ net-nittin-irc/test/test-parse-message.lisp Mon Nov 24 22:10:52 2003 @@ -1,4 +1,4 @@ -;;;; $Id: test-parse-message.lisp,v 1.3 2003/11/23 23:35:30 eenge Exp $ +;;;; $Id: test-parse-message.lisp,v 1.4 2003/11/25 03:10:52 eenge Exp $ ;;;; $Source: /project/net-nittin-irc/cvsroot/net-nittin-irc/test/test-parse-message.lisp,v $
;;;; See the LICENSE file for licensing information. @@ -7,7 +7,9 @@
(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)) +(defvar *msg3* (format nil "NOTICE AUTH :*** Your forward and reverse DNS don't match~A" #\Return)) +(defvar *msg4* (format nil ":kire_!~~eenge@adsl-156-35-240.asm.bellsouth.net MODE #lisppaste +k key~A" #\Return)) +(defvar *msg5* (format nil ":kire_!~~eenge@adsl-156-35-240.asm.bellsouth.net MODE #lisppaste +bbb *!*@somewhere.com *!*@somewhereles.com *!*@youdontwannaknow.org~A" #\Return))
(deftest find-reply-name.1 (irc:find-reply-name 1) :rpl_welcome) (deftest find-reply-name.2 @@ -17,22 +19,32 @@ (deftest return-source.1 (irc::return-source nni-test::*msg1*) 5 "kire") (deftest return-source.2 (irc::return-source nni-test::*msg2*) 21 "tolkien.freenode.net") (deftest return-source.3 (irc::return-source nni-test::*msg3*) 0 nil) +(deftest return-source.4 (irc::return-source nni-test::*msg4*) 6 "kire_") +(deftest return-source.5 (irc::return-source nni-test::*msg5*) 6 "kire_")
(deftest return-user.1 (irc::return-user nni-test::*msg1* :start 5) 12 "~eenge") (deftest return-user.2 (irc::return-user nni-test::*msg2* :start 21) 21 nil) (deftest return-user.3 (irc::return-user nni-test::*msg3* :start 0) 0 nil) +(deftest return-user.4 (irc::return-user nni-test::*msg4* :start 6) 13 "~eenge") +(deftest return-user.5 (irc::return-user nni-test::*msg5* :start 6) 13 "~eenge")
(deftest return-host.1 (irc::return-host nni-test::*msg1* :start 12) 28 "216.248.178.227") (deftest return-host.2 (irc::return-host nni-test::*msg2* :start 21) 21 nil) (deftest return-host.3 (irc::return-host nni-test::*msg3* :start 0) 0 nil) +(deftest return-host.4 (irc::return-host nni-test::*msg4* :start 13) 47 "adsl-156-35-240.asm.bellsouth.net") +(deftest return-host.5 (irc::return-host nni-test::*msg5* :start 13) 47 "adsl-156-35-240.asm.bellsouth.net")
(deftest return-command.1 (irc::return-command nni-test::*msg1* :start 28) 36 "PRIVMSG") (deftest return-command.2 (irc::return-command nni-test::*msg2* :start 21) 25 "372") (deftest return-command.3 (irc::return-command nni-test::*msg3* :start 0) 6 "NOTICE") +(deftest return-command.4 (irc::return-command nni-test::*msg4* :start 47) 52 "MODE") +(deftest return-command.5 (irc::return-command nni-test::*msg5* :start 47) 52 "MODE")
(deftest return-arguments.1 (irc::return-arguments nni-test::*msg1* :start 36) 44 ("cl-irc")) (deftest return-arguments.2 (irc::return-arguments nni-test::*msg2* :start 25) 33 ("cl-irc")) (deftest return-arguments.3 (irc::return-arguments nni-test::*msg3* :start 6) 12 ("AUTH")) +(deftest return-arguments.4 (irc::return-arguments nni-test::*msg4* :start 52) 70 ("#lisppaste" "+k" "key")) +(deftest return-arguments.5 (irc::return-arguments nni-test::*msg5* :start 52) 132 ("#lisppaste" "+bbb" "*!*@somewhere.com" "*!*@somewhereles.com" "*!*@youdontwannaknow.org"))
(deftest return-trailing-argument.1 (irc::return-trailing-argument nni-test::*msg1* :start 44) 52 "heyhey!") @@ -40,6 +52,10 @@ (irc::return-trailing-argument nni-test::*msg2* :start 33) 35 "-") (deftest return-trailing-argument.3 (irc::return-trailing-argument nni-test::*msg3* :start 12) 57 "*** Your forward and reverse DNS don't match") +(deftest return-trailing-argument.4 + (irc::return-trailing-argument nni-test::*msg4* :start 70) 70 nil) +(deftest return-trailing-argument.5 + (irc::return-trailing-argument nni-test::*msg5* :start 132) 132 nil)
(deftest parse-raw-message.1 (irc::parse-raw-message nni-test::*msg1*)
net-nittin-irc-cvs@common-lisp.net