Skip to content

test: add unit tests for convertUint32ToIntSlice, rmMultipleDirs and mapMountFlag#611

Open
Shreya2005-2005 wants to merge 1 commit into
urunc-dev:mainfrom
Shreya2005-2005:test/add-utils-mount-tests
Open

test: add unit tests for convertUint32ToIntSlice, rmMultipleDirs and mapMountFlag#611
Shreya2005-2005 wants to merge 1 commit into
urunc-dev:mainfrom
Shreya2005-2005:test/add-utils-mount-tests

Conversation

@Shreya2005-2005
Copy link
Copy Markdown

Description

Adds unit tests for three helper functions that had no test coverage:

  • convertUint32ToIntSlice in pkg/unikontainers/utils.go: converts a
    []uint32 to []int
  • rmMultipleDirs in pkg/unikontainers/utils.go: removes multiple
    directories under a given prefix path
  • mapMountFlag in pkg/unikontainers/mount.go: maps a mount option
    string to its corresponding flag struct

Related issues

How was this tested?

Ran unit tests locally:
go test ./pkg/unikontainers/... -v -run "TestConvertUint32ToIntSlice|TestRmMultipleDirs|TestMapMountFlag"
All test cases passed. Full package tests also pass:
go test ./pkg/... ./internal/...
Linter passes locally (make lint, 0 issues).

LLM usage

Claude Sonnet 4.6 was used to assist in understanding the codebase
and test structure. All code was reviewed and understood before submission.

Checklist

  • I have read the contribution guide.
  • The linter passes locally (make lint).
  • The e2e tests of at least one tool pass locally.
  • If LLMs were used: I have read the llm policy.

…mapMountFlag

Signed-off-by: Shreya2005-2005 <bhakatmistu2005@gmail.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented May 2, 2026

Deploy Preview for urunc canceled.

Name Link
🔨 Latest commit 12013a0
🔍 Latest deploy log https://app.netlify.com/projects/urunc/deploys/69f654dd01d3090008aff61e

Copy link
Copy Markdown
Contributor

@cmainas cmainas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @Shreya2005-2005 ,

thank you for the PR. However, I am not sure if we should test such small and straightforward functions as unit tests.

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.

Add more unit tests

2 participants