17 #include <glog/logging.h> 22 using namespace folly;
31 auto command =
"rm -rf /"_shellify();
36 command =
"rm -rf {}"_shellify(
"someFile.txt");
37 EXPECT_EQ(command[2],
"rm -rf 'someFile.txt'");
39 command =
"rm -rf {}"_shellify(5);
42 command =
"ls {}"_shellify(
"blah'; rm -rf /");
43 EXPECT_EQ(command[2],
"ls 'blah'\\''; rm -rf /'");
50 TEST(Shell, Shellify_deprecated) {
56 command =
shellify(
"rm -rf {}",
"someFile.txt");
57 EXPECT_EQ(command[2],
"rm -rf 'someFile.txt'");
62 command =
shellify(
"ls {}",
"blah'; rm -rf /");
63 EXPECT_EQ(command[2],
"ls 'blah'\\''; rm -rf /'");
#define FOLLY_GNU_DISABLE_WARNING(warningName)
#define FOLLY_POP_WARNING
#define FOLLY_PUSH_WARNING
std::vector< std::string > shellify(StringPiece format, Arguments &&...arguments)
#define EXPECT_EQ(val1, val2)
—— Concurrent Priority Queue Implementation ——
std::string shellQuote(StringPiece argument)
TEST(SequencedExecutor, CPUThreadPoolExecutor)