2024-02-27 21:27:05 +00:00
|
|
|
#include <gtest/gtest.h>
|
|
|
|
#include <utempl/overloaded.hpp>
|
|
|
|
|
|
|
|
namespace utempl {
|
|
|
|
|
|
|
|
TEST(Overloaded, Basic) {
|
2024-02-27 22:35:29 +00:00
|
|
|
constexpr auto f = Overloaded([](int){
|
2024-02-27 21:27:05 +00:00
|
|
|
return 1;
|
|
|
|
}, [](auto&&){
|
|
|
|
return 2;
|
|
|
|
});
|
|
|
|
EXPECT_EQ(f(1), 1);
|
|
|
|
EXPECT_EQ(f(""), 2);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace utempl
|