DhanushNehru / DhanushNehru/codeskeleton

Add test fixtures and unit tests for each language extractor

Open
#6 0 comments 0 reactions 0 assignees View on GitHub
documentation enhancement help wanted
Dominant language
Rust
Stars
15
Forks
4
PR merge metrics
No merged PRs in 30d

Description

The extraction engine currently has no test fixtures. Add small sample files for each supported language and verify that extraction produces the expected nodes and edges.

### What needs to change:

Create a tests/fixtures/ directory with sample files:
- tests/fixtures/sample.py — a Python file with a class, function, import, and function call
- tests/fixtures/sample.js — same for JavaScript
- tests/fixtures/sample.rs — same for Rust
(one file per supported language)

Add integration tests in tests/extract_test.rs that:
- Parse each fixture file using extract_file()
- Assert the correct number of nodes and edges are extracted
- Assert specific node kinds (e.g., the Python file should have a NodeKind::Class and a NodeKind::Function)
- Assert import edges point to the correct target

Keep fixtures minimal — 10-20 lines each, just enough to exercise all extraction features

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.