diff options
author | Raihaan Shouhell <raihaanhimself@gmail.com> | 2022-12-23 17:52:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-23 10:52:45 +0100 |
commit | d595ded1a9f0ea29a526f62facb74cf30e8fd3b2 (patch) | |
tree | 3fb5d026141567697a1d9c84749a04fc95441f5c /unittest | |
parent | 23bbc238aa663934fb18dfbb0cd638a66d31d687 (diff) | |
download | ccache-d595ded1a9f0ea29a526f62facb74cf30e8fd3b2.tar.gz |
fix: Do not escape backslashes in MSVC RSP files (#1233)
Diffstat (limited to 'unittest')
-rw-r--r-- | unittest/test_Args.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/unittest/test_Args.cpp b/unittest/test_Args.cpp index 8ae2470c..f5d9ae7b 100644 --- a/unittest/test_Args.cpp +++ b/unittest/test_Args.cpp @@ -139,12 +139,12 @@ TEST_CASE("Args::from_atfile") CHECK(args[6] == "seve\nth"); } - SUBCASE("Only escape double quote and backslash in alternate format") + SUBCASE("Only escape double quote in alternate format") { - util::write_file("at_file", "\"\\\"\\a\\ \\\\\\ \\b\\\"\"\\"); + util::write_file("at_file", "\"\\\"\\a\\ \\b\\\"\"\\"); args = *Args::from_atfile("at_file", Args::AtFileFormat::msvc); CHECK(args.size() == 1); - CHECK(args[0] == "\"\\a\\ \\\\ \\b\"\\"); + CHECK(args[0] == "\"\\a\\ \\b\"\\"); } SUBCASE("Ignore single quote in alternate format") @@ -155,6 +155,14 @@ TEST_CASE("Args::from_atfile") CHECK(args[0] == "'a"); CHECK(args[1] == "b'"); } + + SUBCASE("Do not escape backslash in alternate format") + { + util::write_file("at_file", "\"-DDIRSEP='\\\\'\""); + args = *Args::from_atfile("at_file", Args::AtFileFormat::msvc); + CHECK(args.size() == 1); + CHECK(args[0] == "-DDIRSEP='\\\\'"); + } } TEST_CASE("Args copy assignment operator") |