-
Notifications
You must be signed in to change notification settings - Fork 20k
Add Unit Tests for Empty and Single-Node Graphs in TopologicalSort #6263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6263 +/- ##
=========================================
Coverage 74.07% 74.07%
Complexity 5351 5351
=========================================
Files 677 677
Lines 18648 18648
Branches 3621 3621
=========================================
Hits 13813 13813
Misses 4276 4276
Partials 559 559 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Hello maintainers! This PR is ready for review — all checks are passing. Please let me know if any changes are needed. Thank you! 😊 |
src/main/java/com/thealgorithms/graphsearch/TopologicalSort.java
Outdated
Show resolved
Hide resolved
src/main/java/com/thealgorithms/graphsearch/TopologicalSort.java
Outdated
Show resolved
Hide resolved
649d814
to
e79ab50
Compare
e79ab50
to
2c80f84
Compare
Hello @DenizAltunkapan Added new test cases for empty and single-node graphs in the existing src/main/java/com/thealgorithms/sorts/TopologicalSort.java . Please review. Thanks! |
Hello @DenizAltunkapan , I’ve reverted my changes to the pom.xml file and added two test cases for Topological Sort. All checks have passed. Please have a look and review when you get a chance. Thank you looking forward to your feedback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
Description
This PR adds two basic unit tests to improve the test coverage of the existing TopologicalSort implementation in com.thealgorithms.sorts.TopologicalSort.java.
What's Included:
✅ testEmptyGraph(): Ensures that an empty graph returns an empty sorted list.
✅ testSingleNode(): Verifies correct output for a graph with a single node and no edges.
Checklist
clang-format -i --style=file path/to/your/file.java
let me know if improvements are needed. 😊