From d952ac0c079578f3cab2878daefbf30030083fdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Lindqvist?= Date: Wed, 24 Sep 2014 00:46:47 +0200 Subject: [PATCH] smtp.tests: send-mail should be called to get the mock-smtp-server to terminate --- basis/smtp/smtp-tests.factor | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/basis/smtp/smtp-tests.factor b/basis/smtp/smtp-tests.factor index f4cb3e572a..c7127c61b9 100644 --- a/basis/smtp/smtp-tests.factor +++ b/basis/smtp/smtp-tests.factor @@ -1,5 +1,5 @@ -USING: smtp tools.test io.streams.string io.sockets -io.sockets.secure threads smtp.server kernel sequences +USING: combinators continuations smtp tools.test io.streams.string +io.sockets io.sockets.secure threads smtp.server kernel sequences namespaces logging accessors assocs sorting smtp.private concurrency.promises system ; IN: smtp.tests @@ -76,13 +76,17 @@ IN: smtp.tests "Ed " } >>to "Doug " >>from - [ - email>headers sort-keys [ - drop { "Date" "Message-Id" } member? not - ] assoc-filter - ] - [ to>> [ extract-email ] map ] - [ from>> extract-email ] tri + { + [ + email>headers sort-keys [ + drop { "Date" "Message-Id" } member? not + ] assoc-filter + ] + [ to>> [ extract-email ] map ] + [ from>> extract-email ] + ! To get the smtp server to clean up itself + [ [ send-email ] ignore-errors drop ] + } cleave ] with-test-smtp-config ] unit-test