Rename hill-cipher test directory to __test__ for consistency#2152
Closed
Bojun-Vvibe wants to merge 1 commit intotrekhleb:masterfrom
Closed
Rename hill-cipher test directory to __test__ for consistency#2152Bojun-Vvibe wants to merge 1 commit intotrekhleb:masterfrom
__test__ for consistency#2152Bojun-Vvibe wants to merge 1 commit intotrekhleb:masterfrom
Conversation
All other algorithm modules use __test__ as the test directory name. The hill-cipher module was the only outlier using _test_ (single underscores).
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.
Repo: trekhleb/javascript-algorithms (⭐ 195863)
Type: refactor
Files changed: 1
Lines: +0/-0 (file rename only)
What
Renames
src/algorithms/cryptography/hill-cipher/_test_tosrc/algorithms/cryptography/hill-cipher/__test__. Every other algorithm and data-structure module in this repository uses the double-underscore__test__naming convention (verified viafind src -type d -name "_test_*"— hill-cipher is the lone outlier).Why
The repo's
jest.config.jsusestestRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.jsx?$', so tests are found by filename suffix rather than by directory name. That hides the inconsistency at runtime, but the single-underscore directory name is still a typo that breaks the convention used everywhere else insrc/. Aligning it makes the project structure uniform and removes a source of confusion for new contributors looking for tests.Testing
git mvpreserves file history (verified bygit statusshowing the change as a rename).*.test.jssuffix.find src -type d -name "_test_"returns no results after the change;__test__is now the universal convention.Risk
Low — pure directory rename, no code changes, Jest's testRegex matches by file suffix not directory.