From cf8dbddc76c83924de5312623dd3120b9736f26c Mon Sep 17 00:00:00 2001 From: Michael Huth Date: Tue, 7 May 2024 12:09:11 +0200 Subject: [PATCH] Tests: Adapt TestEpochRecreationRemoveUnsupportedUserEpochs to use new functions - use ConvertListToRegexpWithAlternations and PROP_NOT option of FindIndizes --- Packages/tests/UTF_HelperFunctions.ipf | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Packages/tests/UTF_HelperFunctions.ipf b/Packages/tests/UTF_HelperFunctions.ipf index 4714d8ef47..e5ac3b6f84 100644 --- a/Packages/tests/UTF_HelperFunctions.ipf +++ b/Packages/tests/UTF_HelperFunctions.ipf @@ -1146,16 +1146,14 @@ static Function TestEpochRecreationRemoveUnsupportedUserEpochs(WAVE/T epochChann if(type == PSQ_CHIRP) Concatenate/FREE/T/NP {psqChirpEpochs}, supportedUserEpochs endif - supportedUserEpochsRegExp = TextWaveToList(supportedUserEpochs, "|") - supportedUserEpochsRegExp = RemoveEnding(supportedUserEpochsRegExp, "|") - supportedUserEpochsRegExp = "^(?![\s\S]*" + supportedUserEpochsRegExp + ")[\s\S]*$" + supportedUserEpochsRegExp = ConvertListToRegexpWithAlternations(RemoveEnding(TextWaveToList(supportedUserEpochs, ";"), ";"), literal = 0) Make/FREE/T/N=(DimSize(epochChannel, ROWS)) shortnames = EP_GetShortName(epochChannel[p][EPOCH_COL_TAGS]) WAVE/Z userEpochIndices = FindIndizes(shortNames, str = regexpUserEpochs, prop = PROP_GREP) if(!WaveExists(userEpochIndices)) return NaN endif Make/FREE/T/N=(DimSize(userEpochIndices, ROWS)) userEpochShortNames = shortnames[userEpochIndices[p]] - WAVE/Z matches = FindIndizes(userEpochShortNames, str = supportedUserEpochsRegExp, prop = PROP_GREP) + WAVE/Z matches = FindIndizes(userEpochShortNames, str = supportedUserEpochsRegExp, prop = PROP_GREP | PROP_NOT) if(!WaveExists(matches)) return NaN endif