1#include <xrpl/beast/unit_test/suite.h>
2#include <xrpl/beast/utility/PropertyStream.h>
19 BEAST_EXPECT(peeledName == expected);
20 BEAST_EXPECT(s == expectedRemainder);
24 fail(
"unhandled exception");
35 BEAST_EXPECT(found == shouldBeFound);
36 BEAST_EXPECT(s == expected);
40 fail(
"unhandled exception");
54 BEAST_EXPECT(found == shouldBeFound);
55 BEAST_EXPECT(s == expectedRemainder);
59 fail(
"unhandled exception");
69 Source const* source(root.findOne(name));
70 BEAST_EXPECT(source == expected);
74 fail(
"unhandled exception");
84 Source const* source(root.findPath(path));
85 BEAST_EXPECT(source == expected);
89 fail(
"unhandled exception");
99 Source const* source(root.findOneDeep(name));
100 BEAST_EXPECT(source == expected);
104 fail(
"unhandled exception");
114 auto const result(root.find(path));
115 BEAST_EXPECT(result.first == expected);
116 BEAST_EXPECT(result.second == expectedStar);
120 fail(
"unhandled exception");
159 testcase(
"peel_trailing_slashstar");
Subclasses can be called to write to a stream and have children.
static bool peelTrailingSlashstar(std::string *path)
static std::string peelName(std::string *path)
void add(Source &source)
Add a child source.
static bool peelLeadingSlash(std::string *path)
void testFindOne(Source &root, Source *expected, std::string const &name)
void run() override
Runs the suite.
void testPeelName(std::string s, std::string const &expected, std::string const &expectedRemainder)
void testFindPath(Source &root, std::string const &path, Source *expected)
void testPeelLeadingSlash(std::string s, std::string const &expected, bool shouldBeFound)
void testFindOneDeep(Source &root, std::string const &name, Source *expected)
PropertyStream::Source Source
void testPeelTrailingSlashstar(std::string s, std::string const &expectedRemainder, bool shouldBeFound)
void testFind(Source &root, std::string path, Source *expected, bool expectedStar)
Abstract stream with RAII containers that produce a property tree.
void fail(String const &reason, char const *file, int line)
Record a failure.
TestcaseT testcase
Memberspace for declaring test cases.
BEAST_DEFINE_TESTSUITE(aged_set, beast, beast)