ca7fa4001237a13d089564dc7c52b7f04402118e
1 #include "test/lib/common.hpp"
2 #include "test/lib/env.hpp"
4 TEST_CASE("memcached_parser") {
5 SECTION("fail: null string") {
6 REQUIRE_FALSE(memcached(nullptr, 123));
8 SECTION("fail: zero length") {
9 REQUIRE_FALSE(memcached("123", 0));
11 SECTION("success: localhost") {
12 auto mc
= memcached(S("--server=localhost"));
17 SECTION("success: localhost") {
18 SET_ENV(success_localhost
, "LIBMEMCACHED", "--server=localhost");
19 auto mc
= memcached(nullptr, 0);
23 SECTION("success: empty string") {
24 SET_ENV(success_empty_string
, "LIBMEMCACHED", "");
25 auto mc
= memcached(nullptr, 0);
29 SECTION("fail: extra quotes") {
30 SET_ENV(fail_extra_quotes
, "LIBMEMCACHED", "\"--server=localhost\"");
31 REQUIRE_FALSE(memcached(nullptr, 0));