Skip to content

test(cmd/urunc): add unit tests for parseSignal and validate positive signal range - #920

Open
ParthMozarkar wants to merge 1 commit into
urunc-dev:mainfrom
ParthMozarkar:test/kill-signal-validation-tests
Open

test(cmd/urunc): add unit tests for parseSignal and validate positive signal range#920
ParthMozarkar wants to merge 1 commit into
urunc-dev:mainfrom
ParthMozarkar:test/kill-signal-validation-tests

Conversation

@ParthMozarkar

Copy link
Copy Markdown

Summary

This PR improves signal parsing validation in cmd/urunc/kill.go and introduces unit test coverage for cmd/urunc.

Description of Changes

  1. Validation Fix: Updated parseSignal() in cmd/urunc/kill.go to reject non-positive numeric signal inputs (<= 0) with a descriptive error message (invalid signal number %d: must be positive).
  2. Unit Tests: Added cmd/urunc/kill_test.go with table-driven tests covering:
    • Valid named signals (SIGKILL, KILL, kill, SIGTERM)
    • Valid numeric signals (9, 15)
    • Invalid numeric signals (0, -1)
    • Invalid named signal strings (SIGUNKNOWN, FOOBAR)

Related Issue

Closes #917

Verification & Testing

  • Added unit test suite in cmd/urunc/kill_test.go verifying signal parsing edge cases.

@netlify

netlify Bot commented Aug 7, 2026

Copy link
Copy Markdown

Deploy Preview for urunc canceled.

Name Link
🔨 Latest commit 38d2a63
🔍 Latest deploy log https://app.netlify.com/projects/urunc/deploys/6a7638224bfeae0008cec65d

… signal range

Signed-off-by: ParthMozarkar <greatparth21@gmail.com>
@ParthMozarkar
ParthMozarkar force-pushed the test/kill-signal-validation-tests branch from 7d17256 to 38d2a63 Compare August 7, 2026 19:55
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.

[Bug/Testing]: Add positive signal validation in kill.go and unit tests for parseSignal

1 participant