Title: test(cli): unit-test output.rs format_severity/color/confirm by mikolalysenko · Pull Request #69 · SocketDev/socket-patch · GitHub
Open Graph Title: test(cli): unit-test output.rs format_severity/color/confirm by mikolalysenko · Pull Request #69 · SocketDev/socket-patch
X Title: test(cli): unit-test output.rs format_severity/color/confirm by mikolalysenko · Pull Request #69 · SocketDev/socket-patch
Description: Summary Adds 23 unit tests for the formatting helpers in crates/socket-patch-cli/src/output.rs: format_severity (12 tests): all 4 severity levels (critical/high/medium/low) verified with both use_color = true (ANSI prefix + reset, specific color codes 31/91/33/36, input verbatim) and use_color = false (passthrough). Case-insensitive matching covered for critical (uppercase + titlecase) and high (uppercase + lowercase). Unknown severity ("unknown") and empty string each pass through unchanged when color is on. color (3 tests): wraps text with ANSI codes when color is on, passes through when off, and wraps empty text correctly with a multi-code value (1;32). confirm (5 tests): both short-circuit paths (skip_prompt and is_json) verified with both default_yes values, plus a case where both flags are set. The interactive stdin path of confirm, plus stdout_is_tty/stderr_is_tty/stdin_is_tty/select_one, are intentionally not tested because they depend on actual terminal state. Part of the CLI-contract unit-test campaign stacked on #67. Test plan cargo build --workspace --all-features clean cargo clippy --workspace --all-features -- -D warnings clean cargo test --workspace --all-features --lib — all 415 + 23 new tests pass Assisted-by: Claude Code:claude-opus-4-7
Open Graph Description: Summary Adds 23 unit tests for the formatting helpers in crates/socket-patch-cli/src/output.rs: format_severity (12 tests): all 4 severity levels (critical/high/medium/low) verified with both use_...
X Description: Summary Adds 23 unit tests for the formatting helpers in crates/socket-patch-cli/src/output.rs: format_severity (12 tests): all 4 severity levels (critical/high/medium/low) verified with both use_...
Opengraph URL: https://github.com/SocketDev/socket-patch/pull/69
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:41c31146-646b-0616-a0d8-f1b197dd7b6c |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | AB68:18EF1B:1FD7502:2B8FD64:6A4ECF49 |
| html-safe-nonce | c5fe604907e1798fc7eb290523518e9f142f4f3a7dcc400dee26add211ab045d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQjY4OjE4RUYxQjoxRkQ3NTAyOjJCOEZENjQ6NkE0RUNGNDkiLCJ2aXNpdG9yX2lkIjoiNTQxMDE2MzMzMDA4MDc1NTUyOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 59f57763c122d03a6ac4c883d18131e247ea77bc1b9338d75cc14ef43fe384bc |
| hovercard-subject-tag | pull_request:3711894500 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/SocketDev/socket-patch/pull/69/files |
| twitter:image | https://avatars.githubusercontent.com/u/231686?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/231686?s=400&v=4 |
| og:image:alt | Summary Adds 23 unit tests for the formatting helpers in crates/socket-patch-cli/src/output.rs: format_severity (12 tests): all 4 severity levels (critical/high/medium/low) verified with both use_... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/SocketDev/socket-patch git https://github.com/SocketDev/socket-patch.git |
| octolytics-dimension-user_id | 69326764 |
| octolytics-dimension-user_login | SocketDev |
| octolytics-dimension-repository_id | 1093661456 |
| octolytics-dimension-repository_nwo | SocketDev/socket-patch |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1093661456 |
| octolytics-dimension-repository_network_root_nwo | SocketDev/socket-patch |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e6a744804e8e70f97b4d5a18a94dcc63db22f97a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width