#include <boost/regex.hpp>
-#include <folly/Array.h>
+#include <folly/container/Array.h>
#include <folly/portability/GTest.h>
using namespace folly;
EXPECT_GE(127, c);
}
}
-} // namespace
+} // namespace
TEST(Escape, uriEscapeAllCombinations) {
char c[3];
(v >= 'A' && v <= 'F') ||
(v >= 'a' && v <= 'f'));
}
-} // namespace
+} // namespace
TEST(Escape, uriUnescapePercentDecoding) {
char c[4] = {'%', '\0', '\0', '\0'};
return double(int64_t(1) << exponent);
}
-} // namespace
+} // namespace
struct PrettyTestCase{
std::string prettyString;
double realValue;
try{
recoveredX = prettyToDouble(testString, formatType);
} catch (const std::range_error& ex) {
- EXPECT_TRUE(false) << testCase.prettyString << " -> " << ex.what();
+ ADD_FAILURE() << testCase.prettyString << " -> " << ex.what();
}
double relativeError = fabs(x) < 1e-5 ? (x-recoveredX) :
(x - recoveredX) / x;
recoveredX = prettyToDouble(prettyPrint(x, formatType, addSpace),
formatType);
} catch (std::range_error&) {
- EXPECT_TRUE(false);
+ ADD_FAILURE();
}
double relativeError = (x - recoveredX) / x;
EXPECT_NEAR(0, relativeError, 1e-3);
namespace {
-template<template<class,class> class VectorType>
+template <template <class, class> class VectorType>
void splitTest() {
VectorType<string,std::allocator<string> > parts;
EXPECT_EQ(parts[3], "");
}
-template<template<class,class> class VectorType>
+template <template <class, class> class VectorType>
void piecesTest() {
VectorType<StringPiece,std::allocator<StringPiece> > pieces;
VectorType<StringPiece,std::allocator<StringPiece> > pieces2;
EXPECT_EQ(blah.size(), 6);
}
-}
+} // namespace
TEST(Split, split_vector) {
splitTest<std::vector>();
}
return StringPiece(in.end(), in.end());
}
-}
+} // namespace my
TEST(Split, fixed_convert_custom) {
my::Color c1, c2;
EXPECT_EQ("abc\\r", backslashify(string("abc\r")));
EXPECT_EQ("abc\\x0d", backslashify(string("abc\r"), true));
EXPECT_EQ("\\0\\0", backslashify(string(2, '\0')));
+
+ StringPiece input1 = "abc\r";
+ std::string output1 = backslashify(input1);
+ EXPECT_EQ("abc\\r", output1);
}
TEST(String, humanify) {
}
}
-} // anon namespace
+} // namespace
TEST(String, toLowerAsciiAligned) {
static const size_t kSize = 256;