Skip to content

Rename hill-cipher test directory to __test__ for consistency#2152

Closed
Bojun-Vvibe wants to merge 1 commit intotrekhleb:masterfrom
Bojun-Vvibe:agent/trekhleb_javascript-algorithms-1776733302
Closed

Rename hill-cipher test directory to __test__ for consistency#2152
Bojun-Vvibe wants to merge 1 commit intotrekhleb:masterfrom
Bojun-Vvibe:agent/trekhleb_javascript-algorithms-1776733302

Conversation

@Bojun-Vvibe
Copy link
Copy Markdown

Repo: trekhleb/javascript-algorithms (⭐ 195863)
Type: refactor
Files changed: 1
Lines: +0/-0 (file rename only)

What

Renames src/algorithms/cryptography/hill-cipher/_test_ to src/algorithms/cryptography/hill-cipher/__test__. Every other algorithm and data-structure module in this repository uses the double-underscore __test__ naming convention (verified via find src -type d -name "_test_*" — hill-cipher is the lone outlier).

Why

The repo's jest.config.js uses testRegex: '(/__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 in src/. Aligning it makes the project structure uniform and removes a source of confusion for new contributors looking for tests.

Testing

  • git mv preserves file history (verified by git status showing the change as a rename).
  • No source code changes — the test file is unchanged and Jest still discovers it via the *.test.js suffix.
  • Manual verification: 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.

All other algorithm modules use __test__ as the test directory name.
The hill-cipher module was the only outlier using _test_ (single underscores).
@Bojun-Vvibe Bojun-Vvibe closed this by deleting the head repository Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants