Skip to content

Commit

Permalink
Tests: Include ^U_ prefix and $ suffix in regex for user epoch recrea…
Browse files Browse the repository at this point in the history
…tion test
  • Loading branch information
MichaelHuth committed Apr 25, 2024
1 parent 70ec261 commit 07e3642
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Packages/MIES/MIES_Constants.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,7 @@ Constant PSQ_CALC_METHOD_RMS = 0x2 // root-mean-square (rms)
Constant PSQ_BL_FAILED = 1

StrConstant PSQ_BASELINE_CHUNK_SHORT_NAME_PREFIX = "BLC"
StrConstant PSQ_BASELINE_CHUNK_SHORT_NAME_RE_MATCHER = "BLC[[:digit:]]+"
StrConstant PSQ_BASELINE_CHUNK_SHORT_NAME_RE_MATCHER = "^U_BLC[[:digit:]]+$"
/// @}

/// @name PatchSeq labnotebook constants
Expand Down
3 changes: 1 addition & 2 deletions Packages/tests/UTF_HelperFunctions.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -1141,12 +1141,11 @@ static Function TestEpochRecreationRemoveUnsupportedUserEpochs(WAVE/T epochChann
string shortName, supportedUserEpochsRegExp
string regexpUserEpochs = "^" + EPOCH_SHORTNAME_USER_PREFIX + ".*"

Make/FREE/T supportedUserEpochs = {"CR_CE", "CR_SE"}
Make/FREE/T supportedUserEpochs = {"^U_CR_CE$", "^U_CR_SE$"}
Make/FREE/T psqChirpEpochs = {PSQ_BASELINE_CHUNK_SHORT_NAME_RE_MATCHER}
if(type == PSQ_CHIRP)
Concatenate/FREE/T/NP {psqChirpEpochs}, supportedUserEpochs
endif
supportedUserEpochs[] = "^" + EPOCH_SHORTNAME_USER_PREFIX + supportedUserEpochs[p]
supportedUserEpochsRegExp = TextWaveToList(supportedUserEpochs, "|")
supportedUserEpochsRegExp = RemoveEnding(supportedUserEpochsRegExp, "|")
supportedUserEpochsRegExp = "^(?![\s\S]*" + supportedUserEpochsRegExp + ")[\s\S]*$"
Expand Down

0 comments on commit 07e3642

Please sign in to comment.