X-Git-Url: https://git.martlubbers.net/?p=cloogle-irc.git;a=blobdiff_plain;f=test.icl;h=43477449185a184e841d1cfb0168da6d2b0484d4;hp=5ffe81899678f2cef756d31c84f27a83ea6df560;hb=93f0540991809d459cfc3061c88fc07d1cfc948c;hpb=663ea3d6dfb6a70ddf1f3b6c41d4d39ed30c4440 diff --git a/test.icl b/test.icl index 5ffe818..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" Nothing - ,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