+ SECTION("found") {
+ string output;
+ REQUIRE_SUCCESS(memcached_set(*memc, S("memcat"), S("MEMCAT-SET"), 0, 123));
+
+ SECTION("default") {
+ REQUIRE(sh.run(comm + "memcat", output));
+ REQUIRE(output == "MEMCAT-SET\n");
+ }
+ SECTION("flags") {
+ REQUIRE(sh.run(comm + "--flag memcat", output));
+ REQUIRE(output == "123\n");
+ output.clear();
+ REQUIRE(sh.run(comm + "--flag -v memcat", output));
+ REQUIRE(output == "key: memcat\nflags: 123\n");
+ }
+ SECTION("file") {
+ Tempfile temp;
+ REQUIRE(sh.run(comm + "--file " + temp.getFn() + " memcat", output));
+ REQUIRE(output.empty());
+ REQUIRE(temp.get() == "MEMCAT-SET");
+ }
+ }