#include <folly/experimental/TestUtil.h>
#include <folly/portability/GTest.h>
-namespace folly { namespace symbolizer { namespace test {
+namespace folly {
+namespace symbolizer {
+namespace test {
using folly::test::TemporaryFile;
void expect(LineReader& lr, const char* expected) {
StringPiece line;
size_t expectedLen = strlen(expected);
- EXPECT_EQ(expectedLen != 0 ? LineReader::kReading : LineReader::kEof,
- lr.readLine(line));
+ EXPECT_EQ(
+ expectedLen != 0 ? LineReader::kReading : LineReader::kEof,
+ lr.readLine(line));
EXPECT_EQ(expectedLen, line.size());
EXPECT_EQ(std::string(expected, expectedLen), line.str());
}
TEST(LineReader, Simple) {
TemporaryFile file;
int fd = file.fd();
- writeAll(fd,
- "Meow\n"
- "Hello world\n"
- "This is a long line. It is longer than the other lines.\n"
- "\n"
- "Incomplete last line");
+ writeAll(
+ fd,
+ "Meow\n"
+ "Hello world\n"
+ "This is a long line. It is longer than the other lines.\n"
+ "\n"
+ "Incomplete last line");
{
CHECK_ERR(lseek(fd, 0, SEEK_SET));
expect(lr, "");
}
}
-
-}}} // namespaces
+} // namespace test
+} // namespace symbolizer
+} // namespace folly