bin: consolidate clients
authorMichael Wallner <mike@php.net>
Tue, 17 Nov 2020 19:50:18 +0000 (20:50 +0100)
committerMichael Wallner <mike@php.net>
Tue, 17 Nov 2020 19:50:18 +0000 (20:50 +0100)
test/tests/bin/memrm.cpp

index d6a9f7d43c24454b46b4bb79faedfa774ab5389f..9c8d382c90ca65ccaacf539f36f069bfdfa0ffa8 100644 (file)
@@ -12,19 +12,19 @@ TEST_CASE("bin/memrm") {
   SECTION("no servers provided") {
     string output;
     REQUIRE_FALSE(sh.run("memrm", output));
-    REQUIRE(output == "No Servers provided\n");
+    REQUIRE(output == "No servers provided.\n");
   }
 
   SECTION("--help") {
     string output;
     REQUIRE(sh.run("memrm --help", output));
-    REQUIRE_THAT(output, Contains("memrm"));
-    REQUIRE_THAT(output, Contains("v1"));
-    REQUIRE_THAT(output, Contains("help"));
-    REQUIRE_THAT(output, Contains("version"));
-    REQUIRE_THAT(output, Contains("option"));
-    REQUIRE_THAT(output, Contains("--"));
-    REQUIRE_THAT(output, Contains("="));
+    REQUIRE_THAT(output, Contains("memrm v1"));
+    REQUIRE_THAT(output, Contains("Usage:"));
+    REQUIRE_THAT(output, Contains("key [key ...]"));
+    REQUIRE_THAT(output, Contains("-h|--help"));
+    REQUIRE_THAT(output, Contains("-V|--version"));
+    REQUIRE_THAT(output, Contains("Environment:"));
+    REQUIRE_THAT(output, Contains("MEMCACHED_SERVERS"));
   }
 
   SECTION("with server") {
@@ -40,8 +40,9 @@ TEST_CASE("bin/memrm") {
 
     SECTION("not found") {
       string output;
-      REQUIRE(sh.run(comm + "-v key1", output));
-      REQUIRE_THAT(output, Contains("Could not find key \"key1\""));
+      REQUIRE_FALSE(sh.run(comm + "-v key1", output));
+      REQUIRE_THAT(output, Contains("Could not find key 'key1'"));
+      REQUIRE_THAT(output, Contains("NOT FOUND"));
     }
 
     SECTION("okay") {