refacto: moves function to being used on internal test suite only

This commit is contained in:
Nuno Maduro
2024-01-25 14:13:18 +00:00
parent 2562d36518
commit 9c077ed352
2 changed files with 5 additions and 13 deletions

View File

@ -194,16 +194,3 @@ if (! function_exists('afterAll')) {
TestSuite::getInstance()->afterAll->set($closure);
}
}
if (! function_exists('removeAnsiEscapeSequences')) {
/**
* Remove ANSI escape sequences from a given string.
*
* @param string $input The string containing ANSI escape sequences.
* @return string|null A new string with all ANSI escape sequences removed.
*/
function removeAnsiEscapeSequences(string $input): ?string
{
return preg_replace('#\\x1b[[][^A-Za-z]*[A-Za-z]#', '', $input);
}
}

View File

@ -39,3 +39,8 @@ function helper_returns_string()
}
dataset('dataset_in_pest_file', ['A', 'B']);
function removeAnsiEscapeSequences(string $input): ?string
{
return preg_replace('#\\x1b[[][^A-Za-z]*[A-Za-z]#', '', $input);
}