19 #include <ripple/beast/unit_test.h>
20 #include <ripple/beast/utility/PropertyStream.h>
37 BEAST_EXPECT(peeled_name == expected);
38 BEAST_EXPECT(s == expected_remainder);
42 fail(
"unhandled exception");
56 BEAST_EXPECT(found == should_be_found);
57 BEAST_EXPECT(s == expected);
61 fail(
"unhandled exception");
75 BEAST_EXPECT(found == should_be_found);
76 BEAST_EXPECT(s == expected_remainder);
80 fail(
"unhandled exception");
91 BEAST_EXPECT(source == expected);
95 fail(
"unhandled exception");
106 BEAST_EXPECT(source == expected);
110 fail(
"unhandled exception");
121 BEAST_EXPECT(source == expected);
125 fail(
"unhandled exception");
139 auto const result(root.
find(path));
140 BEAST_EXPECT(result.first == expected);
141 BEAST_EXPECT(result.second == expected_star);
145 fail(
"unhandled exception");
172 testcase(
"peel_name");
178 testcase(
"peel_leading_slash");
184 testcase(
"peel_trailing_slashstar");
196 testcase(
"find_one");
202 testcase(
"find_path");
213 testcase(
"find_one_deep");
PropertyStream::Source * find_path(std::string path)
std::pair< Source *, bool > find(std::string path)
Parse the dot-delimited Source path and return the result.
void test_peel_leading_slash(std::string s, std::string const &expected, bool should_be_found)
Subclasses can be called to write to a stream and have children.
void test_peel_name(std::string s, std::string const &expected, std::string const &expected_remainder)
void test_find_one(Source &root, Source *expected, std::string const &name)
void test_find(Source &root, std::string path, Source *expected, bool expected_star)
static bool peel_leading_slash(std::string *path)
void test_peel_trailing_slashstar(std::string s, std::string const &expected_remainder, bool should_be_found)
void add(Source &source)
Add a child source.
static bool peel_trailing_slashstar(std::string *path)
PropertyStream::Source * find_one(std::string const &name)
Source * find_one_deep(std::string const &name)
void test_find_path(Source &root, std::string const &path, Source *expected)
static std::string peel_name(std::string *path)
BEAST_DEFINE_TESTSUITE(aged_set, container, beast)
void test_find_one_deep(Source &root, std::string const &name, Source *expected)