]> gitweb.factorcode.org Git - factor.git/commitdiff
smtp.tests: send-mail should be called to get the mock-smtp-server to terminate
authorBjörn Lindqvist <bjourne@gmail.com>
Tue, 23 Sep 2014 22:46:47 +0000 (00:46 +0200)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 3 Oct 2014 14:12:27 +0000 (07:12 -0700)
basis/smtp/smtp-tests.factor

index f4cb3e572af1e66686fdd6fa55f2209231940c2e..c7127c61b9081976eba414d39a2f5a70f7e2b5ce 100644 (file)
@@ -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 <dharmatech@factorcode.org>"
             } >>to
             "Doug <erg@factorcode.org>" >>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