Commit Graph

266 Commits

Author SHA1 Message Date
renovate[bot] 7e18ede4fa chore(deps): update rust crate console to v0.16.3 2026-03-13 11:08:38 +01:00
renovate[bot] 8c15121687 chore(deps): update rust crate clap_complete to v4.6.0 2026-03-13 07:10:15 +01:00
renovate[bot] a515dc7212 chore(deps): update rust crate clap_mangen to v0.2.33 2026-03-13 07:09:51 +01:00
renovate[bot] 48172447dc chore(deps): update rust crate clap to v4.6.0 2026-03-13 07:09:25 +01:00
renovate[bot] c66ad4978f chore(deps): update rust crate tempfile to v3.27.0 2026-03-11 07:08:55 +01:00
renovate[bot] e66f06114d fix(deps): update rust crate uucore to 0.7.0 2026-03-10 08:35:42 +01:00
renovate[bot] bf6ad9e94a fix(deps): update rust crate uufuzz to 0.7.0 2026-03-10 07:47:33 +01:00
renovate[bot] e60a81f13a chore(deps): update rust crate uutests to 0.7.0 2026-03-10 07:19:54 +01:00
Jeff Bailey 3dfb724997 Add test documentation and expand CLI test coverage (#46)
* Add test documentation and expand CLI test coverage

Document testing philosophy and expand test suite with better CLI-focused
tests and improved error verification.

Changes:
- Add tests/README.md documenting testing philosophy separating application
  (CLI interface) from library (archive format) testing concerns
- Update README.md with Testing section linking to test documentation
- Add 23 new CLI-focused tests covering:
  * Basic CLI: conflicting operations, missing operation specification
  * Create operations: directory archiving, verbose output, empty archive
    handling, nonexistent file errors
  * Extract operations: verbose output, directory structure preservation
  * Round-trip tests: single/multiple files, directories, empty files,
    special characters in filenames
  * Error handling: permission denied, corrupted archives, dash-prefixed
    filenames with -- separator
  * Verbose output: format verification for create/extract operations
  * CLI parsing: mixed short/long options, option order variations,
    default overwrite behavior
  * Edge cases: filenames with spaces, large file counts (100 files)
- Improve all 8 existing tests with better error verification:
  * Add exit code checks and stderr pattern matching
  * Add no_stderr() assertions for successful operations
  * Add sanity checks for archive file sizes
  * Add TODO comments noting exit code mismatches (usage errors currently
    return 1 instead of documented 64)
- Reorganize tests with clear section headers:
  1. Basic CLI Tests
  2. Create Operation Tests
  3. Extract Operation Tests
  4. Round-trip Tests
  5. Error Handling and Exit Code Tests
  6. Verbose Output Format Tests
  7. CLI Argument Handling Tests
  8. Edge Case Tests

All 31 tests pass. Test suite now has clear documentation explaining what
should be tested at the application level vs library level.

* Align exit codes with GNU tar and modernize tests

- Refactor `uumain` to manually handle `clap` errors, ensuring exit code 64 for command-line syntax errors and exit code 2 for semantic/fatal errors.
- Add mutual exclusion between `--create` and `--extract` operations.
- Update `README.md` and `tests/README.md` with corrected exit code documentation and clarified testing philosophy.
- Modernize `tests/by-util/test_tar.rs`:
    - Define `TAR_BLOCK_SIZE` constant (512 bytes).
    - Use `uutests` convenience methods (`at.touch()`, `at.rmdir()`, etc.).
    - Improve `test_verbose` to use `PathBuf`.
    - Replace `.no_stderr()` with `.no_output()`.
    - Implement a root-user check in `test_create_permission_denied`.
    - Remove redundant or outdated roundtrip and verbose format tests.

* Add missing [test] annotation.

---------

Co-authored-by: Sylvestre Ledru <sylvestre.ledru@gmail.com>
2026-03-08 21:36:45 +01:00
Daniel Hofstetter 3c4267392a Remove uuhelp_parser dependency (#52) 2026-03-08 18:39:28 +01:00
renovate[bot] 25a6fbe0a0 chore(deps): update rust crate libc to v0.2.183 2026-03-08 12:26:50 +01:00
renovate[bot] cf1b2f4b58 chore(deps): update rust crate zip to v8.2.0 2026-03-03 07:18:21 +01:00
renovate[bot] 364a54f557 chore(deps): update rust crate tempfile to v3.26.0 2026-02-24 11:56:47 +01:00
renovate[bot] 6e6854049d chore(deps): update rust crate chrono to v0.4.44 2026-02-23 16:30:39 +01:00
renovate[bot] 5d46924622 chore(deps): update rust crate clap to v4.5.60 2026-02-20 07:10:57 +01:00
renovate[bot] 1dd0e21169 chore(deps): update rust crate zip to v8.1.0 2026-02-17 07:13:40 +01:00
renovate[bot] 6561dd36aa chore(deps): update rust crate clap to v4.5.59 2026-02-17 07:09:16 +01:00
renovate[bot] 76c99f761f chore(deps): update rust crate zip to v8 2026-02-15 11:05:13 +01:00
Valentin 17d5195710 Remove leading slash from file name if path is absolute (#53) 2026-02-14 22:18:40 +01:00
Sylvestre Ledru f549a10116 Merge pull request #93 from cakebaker/bump_rand
Bump `rand` from `0.9.0` to `0.10.0`
2026-02-14 22:15:27 +01:00
Sylvestre Ledru 481f18a258 Merge pull request #94 from cakebaker/ci_remove_duplicate_fmt_job
ci: remove (almost) duplicate fmt job
2026-02-14 22:14:55 +01:00
renovate[bot] a556bffa31 chore(deps): update rust crate libc to v0.2.182 2026-02-13 11:16:10 +01:00
renovate[bot] cba3c3ddd1 chore(deps): update rust crate clap to v4.5.58 2026-02-12 07:18:57 +01:00
renovate[bot] ee96150bbf chore(deps): update rust crate clap_complete to v4.5.66 2026-02-12 07:18:44 +01:00
renovate[bot] 9743b70ac8 chore(deps): update rust crate libfuzzer-sys to v0.4.12 2026-02-11 07:04:02 +01:00