X-Git-Url: https://git.martlubbers.net/?p=cloogle-irc.git;a=blobdiff_plain;f=test.icl;h=43477449185a184e841d1cfb0168da6d2b0484d4;hp=fce029920c1999262e7912e2b14122fe568b229b;hb=1547e1cacf063d05c1ae686e6a1047792e13ef60;hpb=aa96c27332a624f88b0031415374db8f5f6e71eb diff --git a/test.icl b/test.icl index fce0299..4347744 100644 --- a/test.icl +++ b/test.icl @@ -1,17 +1,20 @@ module test -from Data.Func import $ -import Data.Either -import Data.Maybe -import StdEnv +import Gast import IRC +import GenBimap +import Data.Func +import Data.Either + +import Text + +derive ggen IRCMessage, Either, IRCUser, IRCCommand, Maybe, CSepList, IRCNumReply, IRCReplies +derive genShow IRCMessage, Either, IRCUser, IRCCommand, Maybe, CSepList, IRCNumReply, IRCReplies -from Text import class Text(concat), instance Text String +//Doesn't work, generates illegal irc commands with spaces in recipients +Start = concat $ Test [] pParsePrint -Start = concat $ map toString - [NICK "clooglebot" Nothing - ,USER "cloogle" "0" "cloogle" "Cloogle bot" - ,JOIN (CSepList ["#cloogle"]) Nothing - ,PRIVMSG (CSepList ["#cloogle"]) "Hello world" - ,QUIT Nothing - ] +pParsePrint :: IRCMessage -> Bool +pParsePrint a +# str = toString a += either (const False) ((==)str o toString) $ parseIRCMessage str