Skip to content

Add test coverage for ladderize function#51

Merged
dfornika merged 2 commits into
re-root-treefrom
copilot/sub-pr-50
Feb 20, 2026
Merged

Add test coverage for ladderize function#51
dfornika merged 2 commits into
re-root-treefrom
copilot/sub-pr-50

Conversation

Copilot AI commented Feb 20, 2026

Copy link
Copy Markdown
Contributor

The ladderize function had no tests despite the codebase having thorough coverage for other tree functions. This adds 8 tests covering the identified gaps.

Tests added (tree_test.cljs)

  • Sort orderladderize-ascending-larger-clade-first / ladderize-descending-smaller-clade-first: verify first child tip count ordering for each direction
  • Default arityladderize-default-direction-is-ascending: no-arg form equals :ascending
  • Structure preservationladderize-preserves-tip-count / ladderize-preserves-leaf-names: 25-taxon tree retains all leaves by count and name in both directions
  • Edge casesladderize-single-leaf-unchanged: leaf with no children returned as-is; ladderize-idempotent: double-application in same direction is a no-op
  • Round-tripladderize-newick-round-trip: ladderized tree serializes to Newick and re-parses with identical tip set

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: dfornika <145659+dfornika@users.noreply.github.com>
Copilot AI changed the title [WIP] Work in progress to address feedback on 'Re root tree' PR Add test coverage for ladderize function Feb 20, 2026
Copilot AI requested a review from dfornika February 20, 2026 01:03

@dfornika dfornika left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

:+1

@dfornika dfornika marked this pull request as ready for review February 20, 2026 01:06
@dfornika dfornika merged commit 36feecb into re-root-tree Feb 20, 2026
dfornika added a commit that referenced this pull request Feb 20, 2026
* Initial implementation of re-rooting

* Remove old use-memo definition

* Added ladderization button

* Ladderize both ways

* reimplement re-rooting on branches

* Update src/main/app/components/toolbar.cljs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/main/app/components/tree.cljs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* whitespace

* whitespace

* Add test coverage for ladderize function (#51)

* Initial plan

* Add tests for ladderize function

Co-authored-by: dfornika <145659+dfornika@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: dfornika <145659+dfornika@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: dfornika <145659+dfornika@users.noreply.github.com>
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.

2 participants