Skip to content

test(dp): add tests for LongestPalindromicSubsequence and remove main…#7462

Merged
DenizAltunkapan merged 4 commits into
TheAlgorithms:masterfrom
amangupta982:test/longest-palindromic-subsequence
Jun 10, 2026
Merged

test(dp): add tests for LongestPalindromicSubsequence and remove main…#7462
DenizAltunkapan merged 4 commits into
TheAlgorithms:masterfrom
amangupta982:test/longest-palindromic-subsequence

Conversation

@amangupta982

Copy link
Copy Markdown
Contributor

Description

Added comprehensive test coverage for LongestPalindromicSubsequence and cleaned up the implementation:

  • Added LongestPalindromicSubsequenceTest.java with 9 test cases covering empty string, single character, all same characters, already palindrome, null input, and structural correctness checks
  • Removed main() method from implementation (not required per repo style)
  • Added null check that actually throws IllegalArgumentException (was declared but never thrown)
  • Replaced old-style length() == 0 with isEmpty()
  • Simplified verbose if/else into ternary expression
  • Improved Javadoc with @param, @return, and @throws
  • 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 algorithms include a corresponding test class that validates their functionality.
  • All new code is formatted with clang-format -i --style=file path/to/your/file.java

@codecov-commenter

codecov-commenter commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.80%. Comparing base (d792409) to head (03fae68).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #7462      +/-   ##
============================================
+ Coverage     79.72%   79.80%   +0.07%     
- Complexity     7298     7301       +3     
============================================
  Files           803      803              
  Lines         23762    23751      -11     
  Branches       4672     4671       -1     
============================================
+ Hits          18945    18954       +9     
+ Misses         4059     4036      -23     
- Partials        758      761       +3     

☔ View full report in Codecov by Harness.
📢 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.

@amangupta982 amangupta982 marked this pull request as ready for review June 10, 2026 06:58
@DenizAltunkapan

Copy link
Copy Markdown
Member

@amangupta982 Thank you for your contribution

@DenizAltunkapan DenizAltunkapan enabled auto-merge (squash) June 10, 2026 07:44
@DenizAltunkapan DenizAltunkapan merged commit 34079f0 into TheAlgorithms:master Jun 10, 2026
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.

3 participants