X-Git-Url: https://git.martlubbers.net/?p=cloogle-irc.git;a=blobdiff_plain;f=test.icl;h=43477449185a184e841d1cfb0168da6d2b0484d4;hp=da69fcd1f19837946ce0161bb427d81feba6c72a;hb=1547e1cacf063d05c1ae686e6a1047792e13ef60;hpb=a8fbb81c3108a913c6496553346037805157b9c0 diff --git a/test.icl b/test.icl index da69fcd..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 $ Right [("#cloogle", Nothing)] - ,PRIVMSG "#cloogle" "Hello world" - ,QUIT Nothing - ] +pParsePrint :: IRCMessage -> Bool +pParsePrint a +# str = toString a += either (const False) ((==)str o toString) $ parseIRCMessage str