Skip to content

Conversation

@DanielRuthardt
Copy link

πŸ“‘ What

Add tests for most functions.

❓ Why

The test have already helped (before this PR got created) to identify and fix various issues that have been in functions for months and years. Testing is critical in functional programming.

⚑ How to Review

βœ… Testing

  • I have tested my work
  • I need you to test it too

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds comprehensive test coverage for user and file manipulation functions in a bash library. The tests validate various edge cases and have already helped identify bugs that existed for months or years.

Key changes:

  • Added tests for user functions: get_uid, get_shell, get_groups, and get_gid
  • Added tests for file functions: is_world_writable, is_world_readable, is_world_executable, is_world_accessible, inherit_owners, copy_owners, and copy
  • Improved existing get_home test with consistent variable naming and simplified logic

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
libs/user/tests/get_uid/test Tests user ID retrieval for explicit users, current user, environment variable, and custom users
libs/user/tests/get_shell/test Tests shell retrieval for various user scenarios
libs/user/tests/get_home/test Refactored with consistent naming (sudoCommand) and simplified current user test
libs/user/tests/get_groups/test Tests group membership retrieval for single and multiple groups
libs/user/tests/get_gid/test Tests group ID retrieval with complex setup for custom GID
libs/file/tests/is_world_writable/test Tests world-writable permission detection across various permission modes
libs/file/tests/is_world_readable/test Tests world-readable permission detection across various permission modes
libs/file/tests/is_world_executable/test Tests world-executable permission detection across various permission modes
libs/file/tests/is_world_accessible/test Tests accessibility checks for files and directories with nested structures
libs/file/tests/inherit_owners/test Tests ownership inheritance from parent directories
libs/file/tests/copy_owners/test Tests ownership copying between files and directories
libs/file/tests/copy/test Tests file and directory copying with ownership preservation

πŸ’‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@DanielRuthardt DanielRuthardt merged commit acee5b2 into main Nov 14, 2025
13 checks passed
@DanielRuthardt DanielRuthardt deleted the feature/add-tests-for-most-functions branch November 14, 2025 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants