Skip to content

Add DepthLimitedTreeSearch tests + fix LabeledGraphTest Pair import#543

Open
gkneighb wants to merge 2 commits intoaimacode:AIMA4efrom
gkneighb:AIMA4e
Open

Add DepthLimitedTreeSearch tests + fix LabeledGraphTest Pair import#543
gkneighb wants to merge 2 commits intoaimacode:AIMA4efrom
gkneighb:AIMA4e

Conversation

@gkneighb
Copy link
Copy Markdown

@gkneighb gkneighb commented May 7, 2026

Summary

  • Adds a JUnit test class for DepthLimitedTreeSearch covering the algorithm's three return modes — solution, cutoff (null), and failure (empty list) — using the Romania map and binary-tree fixtures already in ProblemFactory. Includes a vacuum-world case that documents the non-minimal path DLS-tree returns when LEFT is a no-op at the leftmost square (no cycle check in tree search).
  • Fixes a pre-existing compile error in LabeledGraphTest: import javafx.util.Pair does not resolve on JDKs without bundled JavaFX (Zulu CA, etc.) and was removed from the JDK in Java 11. Swapped to the project's own aima.core.util.datastructure.Pair, whose constructor and equals match what the test uses.

Addresses the README TODO: "Chapter 3 'core' module: Add tests for all implemented algorithms."

Full :test:test suite: 1272 tests, 0 failures, 0 errors after the change (vs. the suite previously failing to compile due to the JavaFX import on a JavaFX-less JDK 8).

Test plan

  • ./gradlew :test:test --tests aima.test.unit.search.uninformed.DepthLimitedTreeSearchTest — 8/8 pass
  • ./gradlew :test:test — 1272/1272 pass on Zulu OpenJDK 8 aarch64
  • CI green on the PR

🤖 Generated with Claude Code

gregoryneighbors and others added 2 commits May 7, 2026 10:42
…beledGraphTest

The javafx.util.Pair import broke compilation on JDKs without bundled
JavaFX (e.g. Zulu CA) and was removed from the JDK in Java 11. The
project already exposes its own Pair with the constructor and equals
semantics this test uses.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Covers the algorithm's three return modes — solution, cutoff (null),
and failure (empty list) — across the Romania map and binary-tree
fixtures, plus a vacuum-world case that documents the non-minimal
path DLS-tree produces when LEFT is a no-op at the leftmost square
(no cycle check in tree search).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.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