#include <boost/lexical_cast.hpp>
#include <folly/Conv.h>
-#include <folly/Foreach.h>
+#include <folly/container/Foreach.h>
#include <folly/portability/GTest.h>
#include <algorithm>
EXPECT_TRUE(to<bool>(42ul));
}
-template<typename Src>
+template <typename Src>
void testStr2Bool() {
EXPECT_FALSE(to<bool>(Src("0")));
EXPECT_FALSE(to<bool>(Src(" 000 ")));
}
}
}
-}
+} // namespace
#define EXPECT_CONV_ERROR_QUOTE(expr, code, value, quoted) \
testConvError( \
oss << to<std::string>(value);
return oss.str();
}
-}
+} // namespace
#define EXPECT_CONV_ERROR_ARITH(type, val, code) \
EXPECT_CONV_ERROR_QUOTE( \
return 2000 + folly::estimateSpaceNeeded(in.w) +
folly::estimateSpaceNeeded(in.h);
}
-}
+} // namespace my
TEST(Conv, custom_kkproviders) {
my::Dimensions expected{7, 8};
// make sure above implementation of estimateSpaceNeeded() is used.
EXPECT_GT(str.capacity(), 2000);
EXPECT_LT(str.capacity(), 2500);
+ // toAppend with other arguments
+ toAppend("|", expected, &str);
+ EXPECT_EQ("7x8|7x8", str);
}
TEST(Conv, TryToThenWithVoid) {