Add unit tests for 22 utility functions in UTF_Utils_WaveHandling.ipf#2623
Add unit tests for 22 utility functions in UTF_Utils_WaveHandling.ipf#2623
Conversation
|
@copilot What you have done does not compile. The error from https://github.com/AllenInstitute/MIES/actions/runs/21649044488/job/62409915716?pr=2623 is Please fix it. |
... Fixed in e274495. The issue was using |
|
@copilot Please rebase and squash commits so that we have only one commit in this PR with code changes. Otherwise the CI does not pass. |
I've successfully rebased and squashed the commits into a single commit (028a23d) locally. The commit includes all 1,190 lines of test code with the compilation fix. However, I cannot force-push due to authentication constraints. The squashed commit is ready at commit 028a23d with message "Add comprehensive unit tests for 22 functions in UTF_Utils_WaveHandling.ipf". Could you please force-push this branch or provide guidance on how to push with the available tools? |
0c8fac8 to
242a4df
Compare
|
@copilot The pre-commit check failed with Can you use |
b3b3b35 to
eda85f5
Compare
please fix them.
|
eda85f5 to
ee27a74
Compare
All requested changes already addressed in 84aea30 (committed just before this comment was posted). The commit includes: removed missing tests comment, fixed STWBS/UWN/GLNEE tests, updated CFWTP/MFWTP for global datafolders with CHECK_WAVE, added HEIWNL empty value test, fixed WaveText tests, replaced CHECK(IsNaN) with CHECK_EQUAL_VAR, updated DWTF with proper modes, changed AEINWAL to direct wave note checks, added MTW infinity test, added RTWE1D combined options test, and replaced GST tests with GetEmptyWavesOfAllTypes data generator. |
|
Fixed in cc52f15. Changed GST_ReturnsCorrectSize to use WaveType() with IGOR_TYPE constants instead of GetDimLabel(), since individual waves from the data generator don't have dimension labels. |
|
@copilot The test GST_ReturnsCorrectSize does not compile as you can't name variables like functions. Please rename |
|
Fixed in e006df4.
|
e006df4 to
f1f37cf
Compare
|
@copilot The test MTW_PrefersFirstWaveWithInfinity fails with please fix it. |
... Fixed in 11428f5. Renamed to MTW_PrefersSecondWaveWhenFirstHasInfinity with correct expectations. Since IsFinite() returns false for both NaN and Inf/-Inf, MergeTwoWaves prefers wv2's finite values (4, 5) over wv1's non-finite Inf/-Inf values. |
Passing a null string for a non-reference string parameter triggers an RTE already. So we don't need to check for this case.
…is global Otherwise the created wave is still free.
We do support skipping the value in AddEntryIntoWaveNoteAsList so it makes sense to support an empty value here as well.
…andling.ipf Co-authored-by: t-b <1185677+t-b@users.noreply.github.com>
11428f5 to
ed26a88
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive unit tests for 22 previously untested utility functions in UTF_Utils_WaveHandling.ipf. It removes the commented list of missing tests and adds 112+ test functions with near-complete code coverage. The PR also includes minor bug fixes to support empty values in HasEntryInWaveNoteList and corrections to use IsEmpty instead of IsNull in SplitTextWaveBySuffix, plus defensive assertions in ConvertFreeWaveToPermanent and MoveFreeWaveToPermanent.
Changes:
- Removed commented list of 22 missing test functions
- Added 112+ comprehensive test functions covering all edge cases, error conditions, and normal operations
- Updated HasEntryInWaveNoteList to support empty values
- Changed SplitTextWaveBySuffix to use IsEmpty instead of IsNull
- Added assertions to ensure global datafolders in ConvertFreeWaveToPermanent and MoveFreeWaveToPermanent
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| UTF_Utils_WaveHandling.ipf | Removed commented list of missing tests (lines 6-29) and added 112+ comprehensive test functions for 22 utility functions (lines 2494-3686) |
| MIES_Utilities_WaveHandling.ipf | Fixed HasEntryInWaveNoteList to support empty values, changed SplitTextWaveBySuffix to use IsEmpty, and added datafolder type assertions to ConvertFreeWaveToPermanent and MoveFreeWaveToPermanent |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Thanks for opening a PR in MIES ✨!
here for the detailed explanation.
Description
Adds comprehensive unit tests for 22 previously untested utility functions in UTF_Utils_WaveHandling.ipf. Tests are designed to achieve near 100% code coverage and trigger all assertions, following the codebase convention of using constants over magic numbers.
Functions Tested
Implementation Details
Changes Made
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.