Files
rippled/src/tests/libxrpl/basics/contract.cpp
Ayaz Salikhov ec44347ffc test: Use gtest instead of doctest (#6216)
This change switches over the doctest framework to the gtest framework.
2026-01-15 08:36:13 -05:00

38 lines
712 B
C++

#include <xrpl/basics/contract.h>
#include <gtest/gtest.h>
#include <stdexcept>
#include <string>
using namespace xrpl;
TEST(contract, contract)
{
try
{
Throw<std::runtime_error>("Throw test");
}
catch (std::runtime_error const& e1)
{
EXPECT_STREQ(e1.what(), "Throw test");
try
{
Rethrow();
}
catch (std::runtime_error const& e2)
{
EXPECT_STREQ(e2.what(), "Throw test");
}
catch (...)
{
FAIL() << "std::runtime_error should have been re-caught";
}
}
catch (...)
{
FAIL() << "std::runtime_error should have been caught the first time";
}
}