Skip to content

Do not record recent files in test mode (#50)#139

Open
cansin wants to merge 3 commits into
useocl:mainfrom
cansin:issue-50-recent-files-testmode
Open

Do not record recent files in test mode (#50)#139
cansin wants to merge 3 commits into
useocl:mainfrom
cansin:issue-50-recent-files-testmode

Conversation

@cansin

@cansin cansin commented Jun 9, 2026

Copy link
Copy Markdown

Summary

Fixes #50.

Running USE in test mode (-t) — e.g. the ShellIT integration tests — opened
files through the shell and recorded them in the user's recent files list,
pushing out the user's own entries.

Fix

RecentItems.push(...) now returns early when Options.testMode is set, so
nothing is recorded while USE runs in test mode. RecentItems and Options are
in the same package, and recentSpecifications is the only RecentItems
instance, so this single guard covers every path that records recent files (the
shell open command, and the spec-file push in the launchers — the latter was
already guarded the same way).

The user's recent files (stored in Java Preferences) are therefore left untouched
by the test suite.

Testing

  • New RecentItemsTest (use-core): push is ignored in test mode and still
    records normally otherwise.
  • The full use-core suite and the 129 ShellIT integration tests pass. No
    integration test depends on reopen / recent files.

claude added 3 commits June 9, 2026 06:06
Running the integration tests (and any USE run with -t) opened files via
the shell, which pushed them onto the user's recent files list and pushed
out the user's own entries.

RecentItems.push now returns early when Options.testMode is set, so no
recent items are recorded while USE runs in test mode. The recent files
(stored in the user's preferences) are therefore left untouched by the
test suite. The spec-file push in the launchers was already guarded this
way; this covers the remaining path (the shell "open" command).

Adds RecentItemsTest verifying push is ignored in test mode and still
records otherwise.

https://claude.ai/code/session_01A85dAvTAvi2oWkGZH6REEq
Add @author Cansin Yildiz and @author Claude to the files added in this
branch, and update the copyright year to 1999-2026.

Co-authored-by: Claude <noreply@anthropic.com>
https://claude.ai/code/session_01A85dAvTAvi2oWkGZH6REEq
@cansin cansin force-pushed the issue-50-recent-files-testmode branch from 3ded03e to d8264a7 Compare June 9, 2026 06:43
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.

Running integration tests should not result in testfiles appearing in recent files

2 participants