Skip to content

Add tests for find/replace UI history store and overlay#4000

Merged
HeikoKlare merged 1 commit into
eclipse-platform:masterfrom
HeikoKlare:add-find-replace-history-tests
Jun 1, 2026
Merged

Add tests for find/replace UI history store and overlay#4000
HeikoKlare merged 1 commit into
eclipse-platform:masterfrom
HeikoKlare:add-find-replace-history-tests

Conversation

@HeikoKlare
Copy link
Copy Markdown
Contributor

@HeikoKlare HeikoKlare commented May 14, 2026

Motivation

The history feature of the find/replace UI lacked test coverage, as documented in #2100.

Changes

HistoryStoreTest — unit tests for HistoryStore

HistoryStore carries non-trivial logic (newest-first ordering, in-place deduplication, size-limit enforcement, IDialogSettings persistence) that warrants direct unit testing. Without these, failures in this layer would only surface as hard-to-diagnose UI test failures.

Integration tests for history storage behaviour

Unit tests cannot detect wiring mistakes such as a missing storeHistory() call in an action handler. New integration tests in FindReplaceUITest verify that search terms are correctly persisted after search and replace operations, and that history ordering and deduplication work end-to-end. Running them in the common superclass ensures both the overlay and the dialog are covered.

IFindReplaceUIAccess gains selectFindHistoryEntry(int index) to abstract over the two navigation mechanisms: ARROW_DOWN simulation in the overlay text field, and programmatic combo selection in the dialog.

Two overlay-specific tests remain in FindReplaceOverlayTest to cover the directional search buttons, which have no dialog counterpart.

Notes

This PR was created with the help of Claude Code.

@HeikoKlare HeikoKlare force-pushed the add-find-replace-history-tests branch from b81b360 to 0548bfe Compare May 14, 2026 08:33
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

Test Results

   864 files  ± 0     864 suites  ±0   53m 16s ⏱️ + 1m 33s
 8 019 tests +29   7 776 ✅ +29  243 💤 ±0  0 ❌ ±0 
20 496 runs  +72  19 841 ✅ +72  655 💤 ±0  0 ❌ ±0 

Results for commit 32d95f4. ± Comparison against base commit a6ae91c.

♻️ This comment has been updated with latest results.

@HeikoKlare HeikoKlare marked this pull request as ready for review May 14, 2026 12:00
The history feature of the find/replace UI lacks test coverage in two
distinct areas:

HistoryStore (unit tests): HistoryStoreTest covers the storage class in
isolation — ordering (newest-first), deduplication, size-limit
enforcement, remove semantics, persistence across instances sharing the
same IDialogSettings, and independence of separate sections. Unit tests
are necessary here because the class carries non-trivial logic (e.g. the
in-place deduplication loop in write()) that should be verified without
spinning up the Eclipse workbench, and because failures in this layer
would otherwise only surface as hard-to-diagnose UI test failures.

Find/replace UI (integration tests): five new tests in FindReplaceUITest
verify that history is correctly populated after search, replace-all,
and
single replace, and that entries are ordered newest-first with
duplicates
suppressed. Running them in the common superclass ensures both the
overlay
and the dialog are covered. IFindReplaceUIAccess gains
selectFindHistoryEntry(int)
to abstract over the two different navigation mechanisms (ARROW_DOWN in
the overlay text field, combo selection in the dialog). Two additional
tests remain in FindReplaceOverlayTest to cover the overlay-specific
forward and backward search buttons, which have no dialog counterpart.

Fixes eclipse-platform#2100
@HeikoKlare HeikoKlare force-pushed the add-find-replace-history-tests branch from 0548bfe to 32d95f4 Compare June 1, 2026 19:23
@HeikoKlare HeikoKlare merged commit 59cc8cc into eclipse-platform:master Jun 1, 2026
18 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.

1 participant