-
Notifications
You must be signed in to change notification settings - Fork 16
Added Node.js unit tests for core JavaScript utilities #636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
1da3a5d
Added Node.js unit tests for core JavaScript utilities
xr843 767397e
Merge branch 'main' into feat/node-tests
xr843 d2317a7
Address review feedback: relocate tests, improve assertions, add cove…
xr843 13d2f57
Merge remote-tracking branch 'upstream/main' into feat/node-tests
xr843 0815a59
refactor: load search_functions.js directly, add handleSearchMessage …
xr843 347f68c
test: add +-, --, -+ prefix combination tests for handleSearchMessage
xr843 11747da
test: address review feedback — add html-validate and missing test cases
xr843 bc8f37c
fix(test): add HTML validation in categoryName loop + flip assertion …
xr843 8a1e6d5
fix(search): use numeric for-loop instead of for-in on positions array
xr843 e5bd70e
test(search): flip test data to catch greedy blurb selection
xr843 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(search): use numeric for-loop instead of for-in on positions array
for (var i in positions) yields string keys ("0", "1", ...),
causing j = i + 1 to produce "01" (string concatenation) instead
of 1 (numeric addition). This made the inner while-loop skip
positions[1] for i=0 and exit immediately for all other starting
indices, so the algorithm always selected the first match's window
regardless of where the densest cluster was.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>- Loading branch information
There are no files selected for viewing
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent! This is why I asked for the flipped test. I had a feeling there was a bug! 😁