Merge branch 'master' of git://factorcode.org/git/factor

db4
sheeple 2008-12-02 15:59:23 -06:00
commit 6d183a7410
2 changed files with 7 additions and 8 deletions

View File

@ -19,7 +19,7 @@ M: mb-reader stream-readln ( mb-reader -- str/f ) lines>> mailbox-get ;
M: mb-writer stream-nl ( mb-writer -- ) M: mb-writer stream-nl ( mb-writer -- )
[ [ last-line>> concat ] [ lines>> ] bi push ] keep [ [ last-line>> concat ] [ lines>> ] bi push ] keep
V{ } clone >>last-line drop ; V{ } clone >>last-line drop ;
M: mb-reader dispose drop ; M: mb-reader dispose f swap push-line ;
M: mb-writer dispose drop ; M: mb-writer dispose drop ;
: spawn-client ( -- irc-client ) : spawn-client ( -- irc-client )
@ -39,7 +39,7 @@ M: mb-writer dispose drop ;
[ in-messages>> 0.1 seconds ] dip mailbox-get-timeout? ; [ in-messages>> 0.1 seconds ] dip mailbox-get-timeout? ;
: with-irc ( quot: ( -- ) -- ) : with-irc ( quot: ( -- ) -- )
[ spawn-client ] dip [ f %push-line ] compose with-irc-client ; inline [ spawn-client ] dip [ irc> terminate-irc ] compose with-irc-client ; inline
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! TESTS ! TESTS
@ -69,8 +69,7 @@ M: mb-writer dispose drop ;
{ V{ "NICK factorbot" "USER factorbot hostname servername :irc.factor" } } [ { V{ "NICK factorbot" "USER factorbot hostname servername :irc.factor" } } [
"someserver" irc-port "factorbot" f <irc-profile> <irc-client> "someserver" irc-port "factorbot" f <irc-profile> <irc-client>
[ 2drop <test-stream> t ] >>connect [ 2drop <test-stream> t ] >>connect
[ connect-irc ] keep [ connect-irc ] [ stream>> out>> lines>> ] [ terminate-irc ] tri
stream>> [ in>> [ f ] dip push-line ] [ out>> lines>> ] bi
] unit-test ] unit-test
! Test join ! Test join

View File

@ -297,7 +297,7 @@ DEFER: (connect-irc)
|dispose stream-readln [ |dispose stream-readln [
parse-irc-line handle-reader-message t parse-irc-line handle-reader-message t
] [ ] [
irc> terminate-irc f handle-disconnect
] if* ] if*
] with-destructors ; ] with-destructors ;