10#include <boost/test/unit_test.hpp>
12BOOST_AUTO_TEST_SUITE(script_parse_tests)
15 const std::vector<std::pair<std::string,std::string>> IN_OUT{
44 for (
const auto& [in,
out] : IN_OUT) {
46 all_in +=
" " + in +
" ";
51 BOOST_CHECK_EXCEPTION(
ParseScript(
"11111111111111111111"), std::runtime_error,
HasReason(
"script parse error: decimal numeric value only allowed in the range -0xFFFFFFFF...0xFFFFFFFF"));
52 BOOST_CHECK_EXCEPTION(
ParseScript(
"11111111111"), std::runtime_error,
HasReason(
"script parse error: decimal numeric value only allowed in the range -0xFFFFFFFF...0xFFFFFFFF"));
53 BOOST_CHECK_EXCEPTION(
ParseScript(
"OP_CHECKSIGADD"), std::runtime_error,
HasReason(
"script parse error: unknown opcode"));
BOOST_CHECK_EXCEPTION predicates to check the specific validation error.
CScript ParseScript(const std::string &s)
BOOST_AUTO_TEST_SUITE_END()
std::string HexStr(const Span< const uint8_t > s)
Convert a span of bytes to a lower-case hexadecimal string.
#define BOOST_CHECK_EQUAL(v1, v2)
BOOST_AUTO_TEST_CASE(parse_script)