19 #include <ripple/beast/unit_test.h>
20 #include <ripple/beast/utility/PropertyStream.h>
34 BEAST_EXPECT(peeled_name == expected);
35 BEAST_EXPECT(s == expected_remainder);
39 fail(
"unhandled exception");;
49 BEAST_EXPECT(found == should_be_found);
50 BEAST_EXPECT(s == expected);
54 fail(
"unhandled exception");;
59 std::string const& expected_remainder,
bool should_be_found)
64 BEAST_EXPECT(found == should_be_found);
65 BEAST_EXPECT(s == expected_remainder);
69 fail(
"unhandled exception");;
78 BEAST_EXPECT(source == expected);
82 fail(
"unhandled exception");;
92 BEAST_EXPECT(source == expected);
96 fail(
"unhandled exception");;
106 BEAST_EXPECT(source == expected);
110 fail(
"unhandled exception");;
119 auto const result(root.
find(path));
120 BEAST_EXPECT(result.first == expected);
121 BEAST_EXPECT(result.second == expected_star);
125 fail(
"unhandled exception");;
150 testcase(
"peel_name");
156 testcase(
"peel_leading_slash");
162 testcase(
"peel_trailing_slashstar");
174 testcase(
"find_one");
180 testcase(
"find_path");
191 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)