fix: test: add unit tests for string/path utility edge cases - #117
Open
VedantMadane wants to merge 1 commit into
Open
fix: test: add unit tests for string/path utility edge cases#117VedantMadane wants to merge 1 commit into
VedantMadane wants to merge 1 commit into
Conversation
Fernandez81
requested changes
Aug 24, 2026
Fernandez81
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the contribution. This change does not currently satisfy #20 and cannot be merged as-is:
pathUtil.edge.test.jsimportspacket_stringifier.goas an ES module. Node rejects the.goextension withERR_UNKNOWN_FILE_EXTENSION.- That vendored Pion RTCP file contains Go packet-stringification code and does not export
normalizeSlashes,isAbsolutePath, orjoinPath. As a result, these tests do not exercise any CosmoEdge string/path utility. - The first normalization assertion is too permissive: an unchanged value such as
a\\bstill containsa, so incorrect behavior would pass. The standalonetest:edgescript is also not part of the C++ test target or any CI command.
Please remove the top-level JavaScript test and the root package.json script. Add focused Catch2 cases to the existing test/test_string_util.cc, test/test_path_util.cc, and/or test/test_file_util.cc, using exact expected results from the actual CosmoEdge implementations. Then validate with the repository-supported Docker flow for scripts/build_cpu_test.sh and build_cpu/cosmo-tests.
VedantMadane
force-pushed
the
fix/issue-20
branch
from
August 24, 2026 09:31
f3ca8e1 to
e9f3918
Compare
Extend Catch2 coverage in test_string_util.cc and test_path_util.cc for empty input, consecutive/leading delimiters, trailing separators, compound extensions, and platform path-separator edge cases. Fixes cosmo-wander-ai#20 Signed-off-by: Vedant Madane <6527493+VedantMadane@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add Catch2 unit tests for string/path utility edge cases.
Changes
test/test_string_util.cc— consecutive/leading delimiters, trailing separators, compound extensions, backslash behavior, JoinStrings/Trim edgestest/test_path_util.cc— IsSafePathComponent length/control-byte edges; IsWithinRoot empty/repeated-separator edgesFixes #20