clang-format
This commit is contained in:
@@ -10,9 +10,13 @@ class RealFilesystemTest : public ::testing::Test {
|
||||
protected:
|
||||
void SetUp() override {
|
||||
// Create a unique temporary directory for this test run
|
||||
temp_dir = std::filesystem::temp_directory_path() /
|
||||
("finger_test_" + std::to_string(std::chrono::duration_cast<std::chrono::nanoseconds>(
|
||||
std::chrono::high_resolution_clock::now().time_since_epoch()).count()));
|
||||
temp_dir =
|
||||
std::filesystem::temp_directory_path() /
|
||||
("finger_test_" +
|
||||
std::to_string(
|
||||
std::chrono::duration_cast<std::chrono::nanoseconds>(
|
||||
std::chrono::high_resolution_clock::now().time_since_epoch())
|
||||
.count()));
|
||||
|
||||
// Create the temporary directory
|
||||
std::filesystem::create_directories(temp_dir);
|
||||
@@ -30,7 +34,7 @@ protected:
|
||||
}
|
||||
|
||||
// Helper method to create a test file with specified content
|
||||
void createTestFile(const std::string& filename, const std::string& content) {
|
||||
void createTestFile(const std::string &filename, const std::string &content) {
|
||||
std::filesystem::path file_path = test_base_path / filename;
|
||||
std::ofstream file(file_path);
|
||||
if (file.is_open()) {
|
||||
@@ -40,13 +44,13 @@ protected:
|
||||
}
|
||||
|
||||
// Helper method to create a test directory
|
||||
void createTestDirectory(const std::string& dirname) {
|
||||
void createTestDirectory(const std::string &dirname) {
|
||||
std::filesystem::path dir_path = test_base_path / dirname;
|
||||
std::filesystem::create_directories(dir_path);
|
||||
}
|
||||
|
||||
// Helper method to check if a file exists in the test directory
|
||||
bool testFileExists(const std::string& filename) {
|
||||
bool testFileExists(const std::string &filename) {
|
||||
return std::filesystem::exists(test_base_path / filename);
|
||||
}
|
||||
|
||||
@@ -162,8 +166,8 @@ TEST_F(RealFilesystemTest, ProcessWithFileContainingOnlyNewlines) {
|
||||
createTestFile("newlineuser", user_content);
|
||||
|
||||
std::string result = process("newlineuser", real_fs, test_base_path);
|
||||
// RealFilesystemWrapper reads line by line, so the last empty line after the final \n
|
||||
// is not read as a separate line, resulting in "\n\n\r\n"
|
||||
// RealFilesystemWrapper reads line by line, so the last empty line after the
|
||||
// final \n is not read as a separate line, resulting in "\n\n\r\n"
|
||||
EXPECT_EQ(result, "\n\n\r\n");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user