From 046a2b47c373be1ff5dcebf18a3d872b0dfccf47 Mon Sep 17 00:00:00 2001 From: Tao He Date: Thu, 8 Apr 2021 10:23:01 +0800 Subject: [PATCH] Expose the etcdv3::detail::string_plus_one method. Signed-off-by: Tao He --- etcd/Client.hpp | 4 ++++ tst/EtcdTest.cpp | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/etcd/Client.hpp b/etcd/Client.hpp index bb5f5bc..9c1242f 100644 --- a/etcd/Client.hpp +++ b/etcd/Client.hpp @@ -12,6 +12,10 @@ namespace etcdv3 { class Transaction; + + namespace detail { + std::string string_plus_one(std::string const &value); + } } namespace etcd diff --git a/tst/EtcdTest.cpp b/tst/EtcdTest.cpp index ad3d85b..11d9f35 100644 --- a/tst/EtcdTest.cpp +++ b/tst/EtcdTest.cpp @@ -255,6 +255,12 @@ TEST_CASE("list by range") REQUIRE(4 == resp3.keys().size()); REQUIRE(4 == resp3.values().size()); + etcd::Response resp4 = etcd.ls("/test/new_dir/key1", etcdv3::detail::string_plus_one("/test/new_dir/key")).get(); + REQUIRE(resp4.is_ok()); + CHECK("get" == resp4.action()); + REQUIRE(4 == resp4.keys().size()); + REQUIRE(4 == resp4.values().size()); + CHECK(0 == etcd.ls("/test/new_dir/key1").get().error_code()); CHECK(etcd.rmdir("/test/new_dir", true).get().is_ok());