Skip to content

cmd/ncdu: add unit tests for the TUI#9489

Open
acme wants to merge 5 commits into
rclone:masterfrom
acme:acme/add-ncdu-tui-tests
Open

cmd/ncdu: add unit tests for the TUI#9489
acme wants to merge 5 commits into
rclone:masterfrom
acme:acme/add-ncdu-tui-tests

Conversation

@acme

@acme acme commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

What is the purpose of this change?

Like #9480 I noticed that the ncdu command text user interface didn't have any tests. Turns out tcell makes it easy to test.

Uses tcell's SimulationScreen to render the UI without a real terminal. Covers initialisation defaults, screen layout (header, path bar, footer), cursor navigation, sorting, popup boxes, and visual select mode.

Was the change discussed in an issue or in the forum before?

No

Checklist

  • I have read the contribution guidelines.
  • I have added tests for all changes in this PR if appropriate.
  • I have added documentation for the changes if appropriate.
  • All commit messages are in house style.
  • I'm done, this Pull Request is ready for review :-)

acme added 5 commits June 3, 2026 18:53
Uses tcell's SimulationScreen to render the UI without a real terminal.
Covers initialisation defaults, screen layout (header, path bar,
footer),
cursor navigation, sorting, popup boxes, and visual select mode.
setupDir selects on rootChan and errChan. For small remotes both can
be ready simultaneously and if errChan won the race, root was still
nil when passed to setCurrentDir. Fix by draining rootChan first if
root hasn't been received yet.
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