...

Source file src/github.com/gregjones/httpcache/memcache/memcache_test.go

Documentation: github.com/gregjones/httpcache/memcache

     1  // +build !appengine
     2  
     3  package memcache
     4  
     5  import (
     6  	"net"
     7  	"testing"
     8  
     9  	"github.com/gregjones/httpcache/test"
    10  )
    11  
    12  const testServer = "localhost:11211"
    13  
    14  func TestMemCache(t *testing.T) {
    15  	conn, err := net.Dial("tcp", testServer)
    16  	if err != nil {
    17  		// TODO: rather than skip the test, fall back to a faked memcached server
    18  		t.Skipf("skipping test; no server running at %s", testServer)
    19  	}
    20  	conn.Write([]byte("flush_all\r\n")) // flush memcache
    21  	conn.Close()
    22  
    23  	test.Cache(t, New(testServer))
    24  }
    25  

View as plain text