Skip to content

Commit f7c1dab

Browse files
committed
Use string.find instead of regex
1 parent c6de57e commit f7c1dab

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tests/test_instruction_executor.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include <gtest/gtest.h>
3232
#include <algorithm>
3333
#include <iostream>
34-
#include <regex>
3534
#include <thread>
3635
#include "ur_client_library/ur/instruction_executor.h"
3736
#include "ur_client_library/control/motion_primitives.h"
@@ -250,11 +249,10 @@ TEST(InstructionExecutorTestStandalone, canceling_without_receiving_answer_retur
250249
out_file.open(test_script_file);
251250

252251
std::string line;
253-
std::regex delete_me("socket_send_int\\(TRAJECTORY_RESULT_CANCELED,\\s*\"trajectory_socket\"\\)");
252+
std::string pattern = "socket_send_int(TRAJECTORY_RESULT_CANCELED, \"trajectory_socket\")";
254253
while (std::getline(in_file, line))
255254
{
256-
std::smatch delete_match;
257-
if (!std::regex_search(line, delete_match, delete_me))
255+
if (line.find(pattern) == std::string::npos)
258256
{
259257
out_file << line << std::endl;
260258
}

0 commit comments

Comments
 (0)