Tests: memcached in 0.7.19 works only with next_upstream.
In 0.7.19 memcached module correctly handles keys not in memcached only if
configured with memcached_next_upstream not_found. Add a test to make sure
this workaround will work in the future.
diff --git a/memcached.t b/memcached.t
index 0392559..2e5ade6 100644
--- a/memcached.t
+++ b/memcached.t
@@ -26,7 +26,7 @@
eval { require Cache::Memcached; };
plain(skip_all => 'Cache::Memcached not installed') if $@;
-my $t = Test::Nginx->new()->has('rewrite')->has_daemon('memcached')->plan(2)
+my $t = Test::Nginx->new()->has('rewrite')->has_daemon('memcached')->plan(3)
->write_file_expand('nginx.conf', <<'EOF');
master_process off;
@@ -47,6 +47,12 @@
set $memcached_key $uri;
memcached_pass 127.0.0.1:8081;
}
+
+ location /next {
+ set $memcached_key $uri;
+ memcached_next_upstream not_found;
+ memcached_pass 127.0.0.1:8081;
+ }
}
}
@@ -62,5 +68,6 @@
like(http_get('/'), qr/SEE-THIS/, 'memcached request');
like(http_get('/notfound'), qr/404/, 'memcached not found');
+like(http_get('/next'), qr/404/, 'not found with memcached_next_upstream');
###############################################################################