Skip to content
This repository was archived by the owner on Jun 18, 2026. It is now read-only.

test: add comprehensive tests for GraphFileParser - #93

Merged
sauravbhattacharya001 merged 1 commit into
masterfrom
test/graph-file-parser
Mar 28, 2026
Merged

sauravbhattacharya001 merged 1 commit into
masterfrom
test/graph-file-parser

Conversation

@sauravbhattacharya001

Copy link
Copy Markdown
Owner

Summary

Adds 22 JUnit test cases for \GraphFileParser, which previously had zero test coverage despite being the core file I/O and parsing logic.

Test Coverage

Category Tests
Basic parsing nodes, edges, weights preserved
Edge classification all 5 EdgeType codes correctly classified
Weight validation NaN, Infinity, invalid strings all skipped
Malformed input short edge lines, blank lines, empty files
Section handling case-insensitive headers, nodes-only files
Filter predicate include/exclude types from graph vs classification
Edge labels first edge of each type gets display label
Unknown types unrecognized codes still added to graph
Boundary values zero weight, negative weight
Error handling IOException on missing file

Why This Matters

\GraphFileParser.parse()\ is used by every analysis pipeline and the main UI. A parsing regression (e.g. silently dropping edges or misclassifying types) would propagate to all downstream analysis results.

22 test cases covering:
- Basic node/edge parsing and edge type classification
- Edge weight preservation and validation (NaN, Infinity, invalid)
- Malformed edge lines gracefully skipped with count
- Empty files and nodes-only files
- Blank line and whitespace tolerance
- Case-insensitive section headers
- Filter predicate (include/exclude edge types from graph)
- Unknown edge type codes handled correctly
- First-edge-of-type label assignment for legends
- Zero and negative weights accepted
- I/O error propagation for missing files
- getEdges() returns empty list for unused types
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions github-actions Bot added tests Test additions or fixes size/l labels Mar 19, 2026
@sauravbhattacharya001
sauravbhattacharya001 merged commit cc12b37 into master Mar 28, 2026
4 of 8 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size/l tests Test additions or fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant