Skip to content

Conversation

@LucasAHorn
Copy link
Contributor

This PR builds on the work by @prashantdubeypng in PR #7152 and adds missing unit tests for graph algorithms, addressing issue #7133:

  • BellmanFordTest.java: 10 test methods covering various graph scenarios, including negative edge weights and disconnected graphs.
  • ConnectedComponentTest.java: 15 test methods for DFS-based component counting in different graph structures.
  • MatrixGraphsTest.java: additional BFS/DFS test cases to verify traversal correctness.
  • DijkstraAlgorithmTest.java: comprehensive shortest path tests for weighted graphs.

This PR also applies proper clang-format formatting to ensure all CI checks pass.

Fixes #7133

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized it.
  • All filenames are in PascalCase.
  • All functions and variable names follow Java naming conventions.
  • All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.
  • All new code is formatted with clang-format -i --style=file path/to/your/file.java

prashantdubeypng and others added 3 commits December 9, 2025 19:22
…TheAlgorithms#7133

- Created BellmanFordTest.java with 10 test methods covering various graph scenarios

- Created ConnectedComponentTest.java with 15 test methods for DFS-based component counting

- Enhanced MatrixGraphsTest.java with additional BFS/DFS test cases

- Enhanced DijkstraAlgorithmTest.java with comprehensive shortest path tests

Fixes TheAlgorithms#7133
@codecov-commenter
Copy link

codecov-commenter commented Dec 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.87%. Comparing base (520151a) to head (8ae0f94).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #7156      +/-   ##
============================================
+ Coverage     78.63%   78.87%   +0.24%     
- Complexity     6825     6828       +3     
============================================
  Files           766      766              
  Lines         22607    22607              
  Branches       4444     4444              
============================================
+ Hits          17776    17831      +55     
+ Misses         4118     4064      -54     
+ Partials        713      712       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@DenizAltunkapan DenizAltunkapan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LucasAHorn Thank you for your contribution

@DenizAltunkapan DenizAltunkapan enabled auto-merge (squash) December 10, 2025 09:01
@DenizAltunkapan DenizAltunkapan merged commit 4f40206 into TheAlgorithms:master Dec 10, 2025
7 checks passed
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.

Missing Unit Tests for Graph Algorithms

3 participants