proxygen
|
#include <folly/experimental/DynamicParser.h>
#include <folly/Optional.h>
#include <folly/experimental/TestUtil.h>
#include <folly/portability/GTest.h>
Go to the source code of this file.
Functions | |
void | checkMaybeCoercedKeys (bool coerce, dynamic good_k, dynamic missing_k) |
void | checkCoercedAndUncoercedKeys (dynamic good_k, dynamic missing_k) |
TEST (TestDynamicParser, CoercedAndUncoercedKeys) | |
TEST (TestDynamicParser, OnErrorThrowSuccess) | |
TEST (TestDynamicParser, OnErrorThrowError) | |
TEST (TestDynamicParser, AllParserFeaturesSuccess) | |
template<typename Fn > | |
void | checkXYKeyErrorsAndParseError (const dynamic &d, Fn fn, std::string key_re, std::string parse_re) |
TEST (TestDynamicParser, TestKeyAndParseErrors) | |
TEST (TestDynamicParser, TestRequiredOptionalParseErrors) | |
template<typename Fn > | |
void | checkItemParseError (dynamic d, Fn fn, dynamic real_k, dynamic err_k, std::string re) |
TEST (TestDynamicParser, TestItemParseErrors) | |
TEST (TestDynamicParser, TestErrorNesting) | |
TEST (TestDynamicParser, TestRecordThrowOnDoubleParseErrors) | |
TEST (TestDynamicParser, TestRecordThrowOnChangingValue) | |
TEST (TestDynamicParser, TestThrowOnReleaseWhileParsing) | |
TEST (TestDynamicParser, TestThrowOnReleaseTwice) | |
TEST (TestDynamicParser, TestThrowOnNullValue) | |
TEST (TestDynamicParser, TestThrowOnKeyOutsideCallback) | |
Definition at line 67 of file DynamicParserTest.cpp.
References checkMaybeCoercedKeys().
Referenced by TEST().
void checkItemParseError | ( | dynamic | d, |
Fn | fn, | ||
dynamic | real_k, | ||
dynamic | err_k, | ||
std::string | re | ||
) |
Definition at line 293 of file DynamicParserTest.cpp.
References folly::dynamic::at(), folly::pushmi::operators::error(), EXPECT_EQ, EXPECT_PCRE_MATCH, folly::dynamic::object(), folly::DynamicParser::RECORD, and folly::DynamicParser::releaseErrors().
Referenced by TEST().
Definition at line 38 of file DynamicParserTest.cpp.
References folly::dynamic::at(), EXPECT_EQ, EXPECT_PCRE_MATCH, k, folly::dynamic::object(), folly::DynamicParser::RECORD, folly::DynamicParser::releaseErrors(), folly::DynamicParser::required(), and folly::DynamicParser::setAllowNonStringKeyErrors().
Referenced by checkCoercedAndUncoercedKeys().
void checkXYKeyErrorsAndParseError | ( | const dynamic & | d, |
Fn | fn, | ||
std::string | key_re, | ||
std::string | parse_re | ||
) |
Definition at line 224 of file DynamicParserTest.cpp.
References folly::dynamic::at(), EXPECT_EQ, EXPECT_PCRE_MATCH, folly::dynamic::object(), folly::DynamicParser::RECORD, and folly::DynamicParser::releaseErrors().
Referenced by TEST().
TEST | ( | TestDynamicParser | , |
CoercedAndUncoercedKeys | |||
) |
Definition at line 72 of file DynamicParserTest.cpp.
References checkCoercedAndUncoercedKeys().
TEST | ( | TestDynamicParser | , |
OnErrorThrowSuccess | |||
) |
Definition at line 80 of file DynamicParserTest.cpp.
References folly::dynamic::array(), EXPECT_EQ, i, int64_t, folly::dynamic::object(), folly::DynamicParser::optional(), folly::DynamicParser::releaseErrors(), folly::DynamicParser::required(), folly::DynamicParser::THROW, and v.
TEST | ( | TestDynamicParser | , |
OnErrorThrowError | |||
) |
Definition at line 90 of file DynamicParserTest.cpp.
References folly::dynamic::array(), folly::pushmi::operators::error(), folly::DynamicParserParseError::error(), EXPECT_EQ, EXPECT_PCRE_MATCH, EXPECT_THROW, FAIL, int64_t, folly::dynamic::object(), folly::DynamicParser::optional(), folly::DynamicParser::releaseErrors(), folly::DynamicParser::required(), and folly::DynamicParser::THROW.
TEST | ( | TestDynamicParser | , |
AllParserFeaturesSuccess | |||
) |
Definition at line 119 of file DynamicParserTest.cpp.
References folly::dynamic::array(), folly::DynamicParser::arrayItems(), folly::dynamic::asBool(), folly::dynamic::asDouble(), folly::dynamic::asString(), EXPECT_EQ, EXPECT_FALSE, EXPECT_TRUE, FAIL, folly::dynamic::getBool(), folly::dynamic::getInt(), folly::dynamic::getString(), int64_t, k, folly::DynamicParser::key(), folly::dynamic::object(), folly::DynamicParser::objectItems(), folly::DynamicParser::optional(), folly::DynamicParser::RECORD, folly::DynamicParser::releaseErrors(), folly::DynamicParser::required(), string, strings, v, folly::Optional< Value >::value(), and folly::DynamicParser::value().
TEST | ( | TestDynamicParser | , |
TestKeyAndParseErrors | |||
) |
Definition at line 248 of file DynamicParserTest.cpp.
References folly::dynamic::array(), folly::DynamicParser::arrayItems(), checkXYKeyErrorsAndParseError(), folly::dynamic::object(), folly::DynamicParser::objectItems(), folly::DynamicParser::optional(), and folly::DynamicParser::required().
TEST | ( | TestDynamicParser | , |
TestRequiredOptionalParseErrors | |||
) |
Definition at line 271 of file DynamicParserTest.cpp.
References folly::dynamic::array(), folly::dynamic::at(), folly::pushmi::operators::error(), EXPECT_EQ, EXPECT_PCRE_MATCH, int64_t, k, folly::dynamic::object(), folly::DynamicParser::RECORD, folly::DynamicParser::releaseErrors(), folly::DynamicParser::required(), and string.
TEST | ( | TestDynamicParser | , |
TestItemParseErrors | |||
) |
Definition at line 316 of file DynamicParserTest.cpp.
References folly::dynamic::array(), folly::DynamicParser::arrayItems(), checkItemParseError(), int64_t, folly::dynamic::object(), folly::DynamicParser::objectItems(), and string.
TEST | ( | TestDynamicParser | , |
TestErrorNesting | |||
) |
Definition at line 334 of file DynamicParserTest.cpp.
References folly::dynamic::array(), folly::DynamicParser::arrayItems(), folly::dynamic::at(), EXPECT_EQ, int64_t, folly::dynamic::object(), folly::DynamicParser::objectItems(), folly::DynamicParser::optional(), folly::DynamicParser::RECORD, folly::DynamicParser::releaseErrors(), and folly::DynamicParser::required().
TEST | ( | TestDynamicParser | , |
TestRecordThrowOnDoubleParseErrors | |||
) |
Definition at line 400 of file DynamicParserTest.cpp.
References folly::DynamicParser::arrayItems(), EXPECT_PCRE_MATCH, FAIL, folly::DynamicParser::objectItems(), and folly::DynamicParser::RECORD.
TEST | ( | TestDynamicParser | , |
TestRecordThrowOnChangingValue | |||
) |
Definition at line 412 of file DynamicParserTest.cpp.
References EXPECT_PCRE_MATCH, FAIL, folly::DynamicParser::objectItems(), folly::DynamicParser::RECORD, and folly::DynamicParser::required().
TEST | ( | TestDynamicParser | , |
TestThrowOnReleaseWhileParsing | |||
) |
Definition at line 428 of file DynamicParserTest.cpp.
References folly::dynamic::array(), folly::DynamicParser::arrayItems(), EXPECT_THROW, and folly::DynamicParser::RECORD.
TEST | ( | TestDynamicParser | , |
TestThrowOnReleaseTwice | |||
) |
Definition at line 435 of file DynamicParserTest.cpp.
References EXPECT_THROW, folly::DynamicParser::RECORD, and folly::DynamicParser::releaseErrors().
TEST | ( | TestDynamicParser | , |
TestThrowOnNullValue | |||
) |
Definition at line 442 of file DynamicParserTest.cpp.
References EXPECT_THROW, folly::DynamicParser::RECORD, folly::DynamicParser::releaseErrors(), and folly::DynamicParser::value().
TEST | ( | TestDynamicParser | , |
TestThrowOnKeyOutsideCallback | |||
) |
Definition at line 449 of file DynamicParserTest.cpp.
References EXPECT_THROW, folly::DynamicParser::key(), and folly::DynamicParser::RECORD.