From 62c483c94072eb215c5ee63314bfc5880e2dbce5 Mon Sep 17 00:00:00 2001 From: vitaut Date: Mon, 20 Apr 2015 08:08:02 -0700 Subject: [PATCH] Test EnableIf --- test/util-test.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/util-test.cc b/test/util-test.cc index 3bca3d46..cb2f5d96 100644 --- a/test/util-test.cc +++ b/test/util-test.cc @@ -842,3 +842,19 @@ TEST(UtilTest, IsEnumConvertibleToInt) { } #endif +template +bool check_enable_if( + typename fmt::internal::EnableIf::type) { + return true; +} + +template +bool check_enable_if( + typename fmt::internal::EnableIf::type) { + return false; +} + +TEST(UtilTest, EnableIf) { + EXPECT_TRUE(check_enable_if(42)); + EXPECT_FALSE(check_enable_if('a')); +}