-
Notifications
You must be signed in to change notification settings - Fork 2
β Add tests for most functions #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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, andget_gid - Added tests for file functions:
is_world_writable,is_world_readable,is_world_executable,is_world_accessible,inherit_owners,copy_owners, andcopy - Improved existing
get_hometest 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.
π 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