Skip to content

Commit

Permalink
[tests] Check quoting \n.
Browse files Browse the repository at this point in the history
  • Loading branch information
luis4a0 committed Jun 20, 2023
1 parent eeb04e9 commit 5d0d8dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,11 +426,11 @@ TEST(Utils, escape_for_shell_actually_escapes)
EXPECT_THAT(res, ::testing::StrEq("I\\'ve\\ got\\ \\\"quotes\\\""));
}

TEST(Utils, escape_for_shell_replaces_newlines_with_spaces)
TEST(Utils, escape_for_shell_quotes_newlines)
{
std::string s{"I've got\nnewlines"};
auto res = mp::utils::escape_for_shell(s);
EXPECT_THAT(res, ::testing::StrEq("I\\'ve\\ got\\ newlines"));
EXPECT_THAT(res, ::testing::StrEq("I\\'ve\\ got\"\n\"newlines"));
}

TEST(Utils, escape_for_shell_quotes_empty_string)
Expand Down

0 comments on commit 5d0d8dd

Please sign in to comment.