]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 6 Sep 2011 16:32:48 +0000 (09:32 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 6 Sep 2011 16:32:48 +0000 (09:32 -0700)
extra/memcached/memcached-tests.factor

index e7c79355d2fdf0bf989625bcd5ca479513ada293..e05c5aadd567de826ce47353ff81c2f0b9e60597 100644 (file)
@@ -1,12 +1,20 @@
 ! Copyright (C) 2010 John Benediktsson
 ! See http://factorcode.org/license.txt for BSD license
 
-USING: arrays assocs calendar math math.functions memcached
-memcached.private kernel present sequences sorting system
+USING: arrays assocs calendar io io.encodings.binary io.sockets
+io.timeouts kernel math math.functions memcached
+memcached.private namespaces present sequences sorting system
 threads tools.test ;
 
 IN: memcached.tests
 
+! Use a version of with-memcached that sets a timeout
+: with-memcached ( quot -- )
+    memcached-server get-global binary [
+        5 seconds input-stream get set-timeout
+        call
+    ] with-client ; inline
+
 <PRIVATE
 
 : not-found? ( quot -- )