Skip to content

dircolors: turn integration test into unit test & remove unsafe code#12547

Merged
sylvestre merged 5 commits into
uutils:mainfrom
cakebaker:dircolors_remove_unsafes
Jun 2, 2026
Merged

dircolors: turn integration test into unit test & remove unsafe code#12547
sylvestre merged 5 commits into
uutils:mainfrom
cakebaker:dircolors_remove_unsafes

Conversation

@cakebaker
Copy link
Copy Markdown
Contributor

This PR does the following changes:

  • turns an integration test into an unit test
  • makes a function and an enum private
  • removes unsafe code in the unit test (changes are adapted from dircolors: remove unsafe #12228 and so I added @oech3 and @xtqqczze as co-authors)
  • removes the OutputFmt::Unknown variant

Closes #12228

@cakebaker cakebaker marked this pull request as draft May 31, 2026 15:37
@cakebaker cakebaker force-pushed the dircolors_remove_unsafes branch from 28aa505 to 6746a52 Compare May 31, 2026 15:46
@cakebaker cakebaker marked this pull request as ready for review May 31, 2026 15:49
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 31, 2026

GNU testsuite comparison:

Skip an intermittent issue tests/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/pr/bounded-memory (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/head/head-write-error is no longer failing!
Note: The gnu test tests/tail/tail-n0f is now being skipped but was previously passing.
Congrats! The gnu test tests/printf/printf-surprise is now passing!
Skip an intermittent issue tests/cut/bounded-memory (was skipped on 'main', now failing)

@oech3
Copy link
Copy Markdown
Contributor

oech3 commented May 31, 2026

Can we avoid unwrap(), unwrap(),... and unwrap() caused by Some(None)?

@cakebaker
Copy link
Copy Markdown
Contributor Author

cakebaker commented Jun 1, 2026

Can we avoid unwrap(), unwrap(),... and unwrap() caused by Some(None)?

I'm not sure I understand you correctly: do you suggest that I should use Some(OutputFmt::<some variant>) instead of using unwrap()s in the test?

Update: I removed the unwrap()s in the latest push.

@cakebaker cakebaker force-pushed the dircolors_remove_unsafes branch from 6746a52 to a454e7a Compare June 1, 2026 07:19
@oech3
Copy link
Copy Markdown
Contributor

oech3 commented Jun 1, 2026

Thankyou. We still have many Some(), but still better than unwrap().

@sylvestre sylvestre merged commit c5ee385 into uutils:main Jun 2, 2026
167 of 169 checks passed
@cakebaker cakebaker deleted the dircolors_remove_unsafes branch June 2, 2026 09:46
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.

3 participants