utempl/tests/overloaded.cpp

21 lines
322 B
C++
Raw Normal View History

2024-07-31 02:19:28 +00:00
module;
#include <gtest/gtest.h>
2024-07-31 02:19:28 +00:00
export module tests.overloaded;
import utempl;
namespace utempl {
TEST(Overloaded, Basic) {
2024-07-31 02:19:28 +00:00
constexpr auto f = Overloaded(
[](int) {
return 1;
},
[](auto&&) {
return 2;
});
EXPECT_EQ(f(1), 1);
EXPECT_EQ(f(""), 2);
};
2024-07-31 02:19:28 +00:00
} // namespace utempl