Skip to content

Commit 2c37acb

Browse files
authored
Merge pull request #3309 from tautschnig/vs-escape
Escape backslash in string representing Windows path [blocks: #2310]
2 parents df88fe6 + dd0f46d commit 2c37acb

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

unit/util/file_util.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ TEST_CASE("concat_dir_file functionality", "[core][util][file_util]")
2020
const std::string path = concat_dir_file(temp_dir.path, "bla.txt");
2121

2222
REQUIRE(path.size() > temp_dir.path.size() + std::string("bla.txt").size());
23-
#ifdef _WIN32
23+
#ifdef _WIN32
2424
REQUIRE(path.find('\\') != std::string::npos);
25-
#else
25+
#else
2626
REQUIRE(path.find('/') != std::string::npos);
27-
#endif
27+
#endif
2828

29-
#ifdef _WIN32
30-
const std::string qualified_path = "z:\some\path\foo.txt";
31-
#else
29+
#ifdef _WIN32
30+
const std::string qualified_path = "z:\\some\\path\\foo.txt";
31+
#else
3232
const std::string qualified_path = "/some/path/foo.txt";
33-
#endif
33+
#endif
3434
const std::string path2 = concat_dir_file(temp_dir.path, qualified_path);
3535
REQUIRE(path2 == qualified_path);
3636
}
@@ -39,11 +39,11 @@ TEST_CASE("is_directory functionality", "[core][util][file_util]")
3939
{
4040
temp_dirt temp_dir("testXXXXXX");
4141

42-
#ifdef _WIN32
42+
#ifdef _WIN32
4343
std::ofstream outfile(widen(temp_dir("file")));
44-
#else
44+
#else
4545
std::ofstream outfile(temp_dir("file"));
46-
#endif
46+
#endif
4747

4848
outfile.close();
4949

0 commit comments

Comments
 (0)