 
 ! Test join
 [ { "JOIN #factortest" } [
-      "#factortest" %join
-      irc> stream>> out>> lines>> pop
+      "#factortest" %join %pop-output-line
   ] unit-test
 ] with-irc
 

: %add-named-chat ( chat -- ) irc> attach-chat ;
: %push-line ( line -- ) irc> stream>> in>> push-line yield ;
: %join ( channel -- ) <irc-channel-chat> irc> attach-chat ;

: read-matching-message ( chat quot: ( msg -- ? ) -- irc-message )
    [ in-messages>> 0.1 seconds ] dip mailbox-get-timeout? ;

      [ participant-changed? ] read-matching-message
  ] unit-test
] with-irc

! Send privmsg
[ { "PRIVMSG #factortest :hello" } [
      "#factortest" <irc-channel-chat> [ %add-named-chat ] keep
      "hello" swap speak %pop-output-line
  ] unit-test
] with-irc
