X-Git-Url: https://git.martlubbers.net/?p=cloogle-irc.git;a=blobdiff_plain;f=test.icl;h=43477449185a184e841d1cfb0168da6d2b0484d4;hp=d9ab2b72d69f36e0bfebb0583a2643b323ecaca9;hb=93f0540991809d459cfc3061c88fc07d1cfc948c;hpb=57707b61bf7f52bf8614dbf6860ff116519533e7 diff --git a/test.icl b/test.icl index d9ab2b7..4347744 100644 --- a/test.icl +++ b/test.icl @@ -1,16 +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 + +//Doesn't work, generates illegal irc commands with spaces in recipients +Start = concat $ Test [] pParsePrint -Start :: [String] -Start = map toString - [NICK "clooglebot" - ,USER "cloogle" 0 "Cloogle bot" - ,JOIN [("#cloogle", Nothing)] - ,PRIVMSG "#cloogle" "Hello world" - ,QUIT Nothing - ] +pParsePrint :: IRCMessage -> Bool +pParsePrint a +# str = toString a += either (const False) ((==)str o toString) $ parseIRCMessage str