fix message parsing without prefix
[cloogle-irc.git] / test.icl
index d9ab2b7..f402f99 100644 (file)
--- a/test.icl
+++ b/test.icl
@@ -1,16 +1,12 @@
 module test
 
-from Data.Func import $
-import Data.Either
-import Data.Maybe
-import StdEnv
+
+import gast
 import IRC
 
-Start :: [String]
-Start = map toString
-       [NICK "clooglebot"
-       ,USER "cloogle" 0 "Cloogle bot"
-       ,JOIN [("#cloogle", Nothing)]
-       ,PRIVMSG "#cloogle" "Hello world"
-       ,QUIT Nothing
-       ]
+derive ggen IRCMessage
+
+Start = Test [] pParsePrint
+
+pParsePrint :: IRCMessage -> Bool
+pParsePrint a = toString (parseIRCMessage (toString a)) == toString a