#include <stdplus/exception.hpp>

#include <gtest/gtest.h>

namespace stdplus
{
namespace exception
{

TEST(Exception, IgnoreNoError)
{
    ignore([] {})();
    ignore([]() mutable { throw std::runtime_error("Boom"); })();
    EXPECT_EQ(int(), ignore([]() -> int { throw 1; })());
    auto x = std::make_unique<int>(1);
    auto y = std::make_unique<int>(2);
    auto z = std::make_unique<int>(3);
    EXPECT_EQ(3, ignore([x = std::move(x)](auto&& v) { return *v + *x; })(y));
    EXPECT_EQ(5, ignore([z = std::move(z)](auto v) {
                  return *v + *z;
              })(std::move(y)));
}

TEST(Exception, IgnoreQuiet)
{
    ignoreQuiet([] {})();
    ignoreQuiet([]() mutable { throw std::runtime_error("Boom"); })();
}

} // namespace exception
} // namespace stdplus
