Skip to content

test: Add comprehensive tests for Language::extensions#160

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/add-tests-for-language-module
Draft

test: Add comprehensive tests for Language::extensions#160
Copilot wants to merge 3 commits intomainfrom
copilot/add-tests-for-language-module

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 6, 2026

Issue #54 requested test coverage for the Language::extensions method, which returns file extensions for each supported language.

Changes

Added 5 test functions to crates/mother-core/src/scanner/tests/tests_language.rs:

  • test_language_extensions - Verifies all language variants return correct extensions
  • test_extensions_consistency_with_from_extension - Validates bidirectional consistency between extensions() and from_extension()
  • test_extensions_are_not_empty - Ensures every language has at least one extension
  • test_extensions_multiple_for_typescript - Validates TypeScript's dual extensions (.ts, .tsx)
  • test_extensions_multiple_for_javascript - Validates JavaScript's four extensions (.js, .jsx, .mjs, .cjs)

Example

// Verify extensions match what from_extension accepts
for language in [Language::Rust, Language::Python, /* ... */] {
    for ext in language.extensions() {
        assert_eq!(Language::from_extension(ext), Some(language));
    }
}

The consistency test ensures that extensions() and from_extension() remain synchronized as new extensions are added.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 192.168.1.100
    • Triggering command: /home/REDACTED/work/mother/mother/target/debug/deps/mother_cli-d349731c4bc5c110 /home/REDACTED/work/mother/mother/target/debug/deps/mother_cli-d349731c4bc5c110 ceyf2aem98s7aqgbxg9x3v2s.0zkg3qp.rcgu.o csjiu7eotfqkwlkq6ex4jg0z.0zkg3qp.rcgu.o jk03xox3lff7u1d7hpf7970k.0zkg3qp.rcgu.o kn3qemt1bv0lihu8a5118inn.0zkg3qp.rcgu.o mma15qabx0kkg2rr3t4bgfgc.0zkg3qp.rcgu.o nexhi3i74gcmhw8i50tfqkpv.0zkg3qp.rcgu.o nrkz536hqv555qrcqsztow2g.0zkg3qp.rcgu.o nsk9d1gcjhbhhiqxf3u2d0ui.0zkg3qp.rcgu.o nskb05xauadln0tvcttxwnli.0zkg3qp.rcgu.o o1lbzzvolx1njb7c8ypu72fv.0zkg3qp.rcgu.o rn6xn95ih96oowwjxznl1uk8.0zkg3qp.rcgu.o wxcj�� zn6dendar8cfixi4mtdgdrbb.0zkg3qp.rcgu.o 3iha0r1drgjqvxwh0a8p69xq.0zkg3qp.rcgu.o ndor/bin/as it2 217e8a4ca5-crede--norc (packet block)
    • Triggering command: /home/REDACTED/work/mother/mother/target/debug/deps/mother_cli-d349731c4bc5c110 /home/REDACTED/work/mother/mother/target/debug/deps/mother_cli-d349731c4bc5c110 --test-threads=4 --emit=dep-info,metadata -C opt-level=1 -C embed-bitcode=no certs-0.7.3/src/lib.rs codegen-units=256 -C debuginfo=2 -C ttp target/debug/bui--detach ld/libgit2-sys-6/home/REDACTED/work/mother/mother/target/debug/deps/clap_derive-3c563882b6a5a922.c--crate-name known-linux-gnu//home/REDACTED/work/mother/mother/target/debug/deps/clap_derive-3c563882b6a5a922.cthread_local e -I pointer cc (packet block)
  • invalid-host
    • Triggering command: /home/REDACTED/work/mother/mother/target/debug/deps/mother_cli-d349731c4bc5c110 /home/REDACTED/work/mother/mother/target/debug/deps/mother_cli-d349731c4bc5c110 ceyf2aem98s7aqgbxg9x3v2s.0zkg3qp.rcgu.o csjiu7eotfqkwlkq6ex4jg0z.0zkg3qp.rcgu.o jk03xox3lff7u1d7hpf7970k.0zkg3qp.rcgu.o kn3qemt1bv0lihu8a5118inn.0zkg3qp.rcgu.o mma15qabx0kkg2rr3t4bgfgc.0zkg3qp.rcgu.o nexhi3i74gcmhw8i50tfqkpv.0zkg3qp.rcgu.o nrkz536hqv555qrcqsztow2g.0zkg3qp.rcgu.o nsk9d1gcjhbhhiqxf3u2d0ui.0zkg3qp.rcgu.o nskb05xauadln0tvcttxwnli.0zkg3qp.rcgu.o o1lbzzvolx1njb7c8ypu72fv.0zkg3qp.rcgu.o rn6xn95ih96oowwjxznl1uk8.0zkg3qp.rcgu.o wxcj�� zn6dendar8cfixi4mtdgdrbb.0zkg3qp.rcgu.o 3iha0r1drgjqvxwh0a8p69xq.0zkg3qp.rcgu.o ndor/bin/as it2 217e8a4ca5-crede--norc (dns block)
    • Triggering command: /home/REDACTED/work/mother/mother/target/debug/deps/mother_cli-d349731c4bc5c110 /home/REDACTED/work/mother/mother/target/debug/deps/mother_cli-d349731c4bc5c110 --test-threads=4 --emit=dep-info,metadata -C opt-level=1 -C embed-bitcode=no certs-0.7.3/src/lib.rs codegen-units=256 -C debuginfo=2 -C ttp target/debug/bui--detach ld/libgit2-sys-6/home/REDACTED/work/mother/mother/target/debug/deps/clap_derive-3c563882b6a5a922.c--crate-name known-linux-gnu//home/REDACTED/work/mother/mother/target/debug/deps/clap_derive-3c563882b6a5a922.cthread_local e -I pointer cc (dns block)
  • invalid-uri
    • Triggering command: /home/REDACTED/work/mother/mother/target/debug/deps/mother_cli-d349731c4bc5c110 /home/REDACTED/work/mother/mother/target/debug/deps/mother_cli-d349731c4bc5c110 ceyf2aem98s7aqgbxg9x3v2s.0zkg3qp.rcgu.o csjiu7eotfqkwlkq6ex4jg0z.0zkg3qp.rcgu.o jk03xox3lff7u1d7hpf7970k.0zkg3qp.rcgu.o kn3qemt1bv0lihu8a5118inn.0zkg3qp.rcgu.o mma15qabx0kkg2rr3t4bgfgc.0zkg3qp.rcgu.o nexhi3i74gcmhw8i50tfqkpv.0zkg3qp.rcgu.o nrkz536hqv555qrcqsztow2g.0zkg3qp.rcgu.o nsk9d1gcjhbhhiqxf3u2d0ui.0zkg3qp.rcgu.o nskb05xauadln0tvcttxwnli.0zkg3qp.rcgu.o o1lbzzvolx1njb7c8ypu72fv.0zkg3qp.rcgu.o rn6xn95ih96oowwjxznl1uk8.0zkg3qp.rcgu.o wxcj�� zn6dendar8cfixi4mtdgdrbb.0zkg3qp.rcgu.o 3iha0r1drgjqvxwh0a8p69xq.0zkg3qp.rcgu.o ndor/bin/as it2 217e8a4ca5-crede--norc (dns block)
    • Triggering command: /home/REDACTED/work/mother/mother/target/debug/deps/mother_cli-d349731c4bc5c110 /home/REDACTED/work/mother/mother/target/debug/deps/mother_cli-d349731c4bc5c110 --test-threads=4 --emit=dep-info,metadata -C opt-level=1 -C embed-bitcode=no certs-0.7.3/src/lib.rs codegen-units=256 -C debuginfo=2 -C ttp target/debug/bui--detach ld/libgit2-sys-6/home/REDACTED/work/mother/mother/target/debug/deps/clap_derive-3c563882b6a5a922.c--crate-name known-linux-gnu//home/REDACTED/work/mother/mother/target/debug/deps/clap_derive-3c563882b6a5a922.cthread_local e -I pointer cc (dns block)
  • neo4j.example.com
    • Triggering command: /home/REDACTED/work/mother/mother/target/debug/deps/mother_cli-d349731c4bc5c110 /home/REDACTED/work/mother/mother/target/debug/deps/mother_cli-d349731c4bc5c110 ceyf2aem98s7aqgbxg9x3v2s.0zkg3qp.rcgu.o csjiu7eotfqkwlkq6ex4jg0z.0zkg3qp.rcgu.o jk03xox3lff7u1d7hpf7970k.0zkg3qp.rcgu.o kn3qemt1bv0lihu8a5118inn.0zkg3qp.rcgu.o mma15qabx0kkg2rr3t4bgfgc.0zkg3qp.rcgu.o nexhi3i74gcmhw8i50tfqkpv.0zkg3qp.rcgu.o nrkz536hqv555qrcqsztow2g.0zkg3qp.rcgu.o nsk9d1gcjhbhhiqxf3u2d0ui.0zkg3qp.rcgu.o nskb05xauadln0tvcttxwnli.0zkg3qp.rcgu.o o1lbzzvolx1njb7c8ypu72fv.0zkg3qp.rcgu.o rn6xn95ih96oowwjxznl1uk8.0zkg3qp.rcgu.o wxcj�� zn6dendar8cfixi4mtdgdrbb.0zkg3qp.rcgu.o 3iha0r1drgjqvxwh0a8p69xq.0zkg3qp.rcgu.o ndor/bin/as it2 217e8a4ca5-crede--norc (dns block)
    • Triggering command: /home/REDACTED/work/mother/mother/target/debug/deps/mother_cli-d349731c4bc5c110 /home/REDACTED/work/mother/mother/target/debug/deps/mother_cli-d349731c4bc5c110 --test-threads=4 --emit=dep-info,metadata -C opt-level=1 -C embed-bitcode=no certs-0.7.3/src/lib.rs codegen-units=256 -C debuginfo=2 -C ttp target/debug/bui--detach ld/libgit2-sys-6/home/REDACTED/work/mother/mother/target/debug/deps/clap_derive-3c563882b6a5a922.c--crate-name known-linux-gnu//home/REDACTED/work/mother/mother/target/debug/deps/clap_derive-3c563882b6a5a922.cthread_local e -I pointer cc (dns block)
  • neo4j.production.example.com
    • Triggering command: /home/REDACTED/work/mother/mother/target/debug/deps/mother_cli-d349731c4bc5c110 /home/REDACTED/work/mother/mother/target/debug/deps/mother_cli-d349731c4bc5c110 ceyf2aem98s7aqgbxg9x3v2s.0zkg3qp.rcgu.o csjiu7eotfqkwlkq6ex4jg0z.0zkg3qp.rcgu.o jk03xox3lff7u1d7hpf7970k.0zkg3qp.rcgu.o kn3qemt1bv0lihu8a5118inn.0zkg3qp.rcgu.o mma15qabx0kkg2rr3t4bgfgc.0zkg3qp.rcgu.o nexhi3i74gcmhw8i50tfqkpv.0zkg3qp.rcgu.o nrkz536hqv555qrcqsztow2g.0zkg3qp.rcgu.o nsk9d1gcjhbhhiqxf3u2d0ui.0zkg3qp.rcgu.o nskb05xauadln0tvcttxwnli.0zkg3qp.rcgu.o o1lbzzvolx1njb7c8ypu72fv.0zkg3qp.rcgu.o rn6xn95ih96oowwjxznl1uk8.0zkg3qp.rcgu.o wxcj�� zn6dendar8cfixi4mtdgdrbb.0zkg3qp.rcgu.o 3iha0r1drgjqvxwh0a8p69xq.0zkg3qp.rcgu.o ndor/bin/as it2 217e8a4ca5-crede--norc (dns block)
    • Triggering command: /home/REDACTED/work/mother/mother/target/debug/deps/mother_cli-d349731c4bc5c110 /home/REDACTED/work/mother/mother/target/debug/deps/mother_cli-d349731c4bc5c110 --test-threads=4 --emit=dep-info,metadata -C opt-level=1 -C embed-bitcode=no certs-0.7.3/src/lib.rs codegen-units=256 -C debuginfo=2 -C ttp target/debug/bui--detach ld/libgit2-sys-6/home/REDACTED/work/mother/mother/target/debug/deps/clap_derive-3c563882b6a5a922.c--crate-name known-linux-gnu//home/REDACTED/work/mother/mother/target/debug/deps/clap_derive-3c563882b6a5a922.cthread_local e -I pointer cc (dns block)
  • nonexistent.host.that.does.not.exist
    • Triggering command: /home/REDACTED/work/mother/mother/target/debug/deps/mother_cli-d349731c4bc5c110 /home/REDACTED/work/mother/mother/target/debug/deps/mother_cli-d349731c4bc5c110 ceyf2aem98s7aqgbxg9x3v2s.0zkg3qp.rcgu.o csjiu7eotfqkwlkq6ex4jg0z.0zkg3qp.rcgu.o jk03xox3lff7u1d7hpf7970k.0zkg3qp.rcgu.o kn3qemt1bv0lihu8a5118inn.0zkg3qp.rcgu.o mma15qabx0kkg2rr3t4bgfgc.0zkg3qp.rcgu.o nexhi3i74gcmhw8i50tfqkpv.0zkg3qp.rcgu.o nrkz536hqv555qrcqsztow2g.0zkg3qp.rcgu.o nsk9d1gcjhbhhiqxf3u2d0ui.0zkg3qp.rcgu.o nskb05xauadln0tvcttxwnli.0zkg3qp.rcgu.o o1lbzzvolx1njb7c8ypu72fv.0zkg3qp.rcgu.o rn6xn95ih96oowwjxznl1uk8.0zkg3qp.rcgu.o wxcj�� zn6dendar8cfixi4mtdgdrbb.0zkg3qp.rcgu.o 3iha0r1drgjqvxwh0a8p69xq.0zkg3qp.rcgu.o ndor/bin/as it2 217e8a4ca5-crede--norc (dns block)
    • Triggering command: /home/REDACTED/work/mother/mother/target/debug/deps/mother_cli-d349731c4bc5c110 /home/REDACTED/work/mother/mother/target/debug/deps/mother_cli-d349731c4bc5c110 --test-threads=4 --emit=dep-info,metadata -C opt-level=1 -C embed-bitcode=no certs-0.7.3/src/lib.rs codegen-units=256 -C debuginfo=2 -C ttp target/debug/bui--detach ld/libgit2-sys-6/home/REDACTED/work/mother/mother/target/debug/deps/clap_derive-3c563882b6a5a922.c--crate-name known-linux-gnu//home/REDACTED/work/mother/mother/target/debug/deps/clap_derive-3c563882b6a5a922.cthread_local e -I pointer cc (dns block)
  • not-a-valid-uri
    • Triggering command: /home/REDACTED/work/mother/mother/target/debug/deps/mother_cli-d349731c4bc5c110 /home/REDACTED/work/mother/mother/target/debug/deps/mother_cli-d349731c4bc5c110 ceyf2aem98s7aqgbxg9x3v2s.0zkg3qp.rcgu.o csjiu7eotfqkwlkq6ex4jg0z.0zkg3qp.rcgu.o jk03xox3lff7u1d7hpf7970k.0zkg3qp.rcgu.o kn3qemt1bv0lihu8a5118inn.0zkg3qp.rcgu.o mma15qabx0kkg2rr3t4bgfgc.0zkg3qp.rcgu.o nexhi3i74gcmhw8i50tfqkpv.0zkg3qp.rcgu.o nrkz536hqv555qrcqsztow2g.0zkg3qp.rcgu.o nsk9d1gcjhbhhiqxf3u2d0ui.0zkg3qp.rcgu.o nskb05xauadln0tvcttxwnli.0zkg3qp.rcgu.o o1lbzzvolx1njb7c8ypu72fv.0zkg3qp.rcgu.o rn6xn95ih96oowwjxznl1uk8.0zkg3qp.rcgu.o wxcj�� zn6dendar8cfixi4mtdgdrbb.0zkg3qp.rcgu.o 3iha0r1drgjqvxwh0a8p69xq.0zkg3qp.rcgu.o ndor/bin/as it2 217e8a4ca5-crede--norc (dns block)
    • Triggering command: /home/REDACTED/work/mother/mother/target/debug/deps/mother_cli-d349731c4bc5c110 /home/REDACTED/work/mother/mother/target/debug/deps/mother_cli-d349731c4bc5c110 --test-threads=4 --emit=dep-info,metadata -C opt-level=1 -C embed-bitcode=no certs-0.7.3/src/lib.rs codegen-units=256 -C debuginfo=2 -C ttp target/debug/bui--detach ld/libgit2-sys-6/home/REDACTED/work/mother/mother/target/debug/deps/clap_derive-3c563882b6a5a922.c--crate-name known-linux-gnu//home/REDACTED/work/mother/mother/target/debug/deps/clap_derive-3c563882b6a5a922.cthread_local e -I pointer cc (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Add comprehensive tests for the language-language module.

Issues to Resolve

CRITICAL REQUIREMENTS

1. TEST THROUGH PUBLIC API ONLY

  • Do NOT make private methods public just for testing
  • Test internal logic through public entrypoint functions
  • If a function is private, test it via the public function that calls it

2. VERIFY LOGIC CORRECTNESS

  • READ and UNDERSTAND the implementation before writing tests
  • Check if the logic makes sense and is correct
  • If you find bugs, note them but still test current behavior

3. TEST FILE LOCATION AND NAMING

  • Unit tests: language_language/tests/tests_*.rs (tests folder inside module)
  • Integration tests: tests/language_language/tests_*.rs (module folder inside root tests/)
  • Use prefix tests_ for all test files (e.g., tests_selection_range.rs)
  • All tests for this batch go in the appropriate folder
  • Example unit test: server/selection_range.rsserver/tests/tests_selection_range.rs
  • Example integration test: server/selection_range.rstests/server/tests_selection_range.rs

4. QUALITY TESTS ONLY

  • NO TODO comments or placeholder tests
  • Test edge cases: empty inputs, error conditions, boundaries
  • Descriptive test names explaining what's tested

5. CLOSE ALL ISSUES IN ONE COMMIT

Commit message: test: Add comprehensive tests for language-language (closes #54)

6. VERIFY BEFORE PR

  • make run-guidelines must pass
  • Then create PR

Create a single PR resolving all 1 issues.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 6, 2026 06:36
Co-authored-by: jade-codes <9397730+jade-codes@users.noreply.github.com>
Co-authored-by: jade-codes <9397730+jade-codes@users.noreply.github.com>
Copilot AI changed the title [WIP] Add comprehensive tests for the language-language module test: Add comprehensive tests for Language::extensions Jan 6, 2026
Copilot AI requested a review from jade-codes January 6, 2026 06:45
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