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