Commit graph

3 commits

Author SHA1 Message Date
google-labs-jules[bot]
e112ec363d feat: Add Good, Bad, and Ugly tests
This commit refactors the test suites for the `crypt` and `enchantrix` packages to follow the "Good, Bad, Ugly" testing methodology.

- `_Good` tests cover the ideal "happy path" scenarios.
- `_Bad` tests cover expected failure scenarios with well-formed but invalid inputs.
- `_Ugly` tests cover malicious or malformed inputs designed to cause crashes or panics.

This change improves test coverage and ensures that the codebase is more robust and resilient to unexpected inputs.
2025-11-13 21:27:38 +00:00
google-labs-jules[bot]
1a4b2923bf test: increase test coverage to 100%
- Refactors `trix.Encode` and `trix.Decode` to allow for dependency injection, enabling the testing of I/O error paths.
- Adds comprehensive tests for the `trix` package to cover all error paths.
- Adds tests for the `Fletcher` checksums and `ensureRSA` function in the `crypt` package.
- Adds tests for the `lthn` package to cover the `SetKeyMap` and `GetKeyMap` functions.
- Adds tests for the `chachapoly` package to cover error paths.
- Adds tests for the `rsa` package to cover error paths.
2025-11-03 00:17:27 +00:00
google-labs-jules[bot]
c286a82e89 feat(tests): Add internal tests for private functions
Adds `_internal_test.go` files to test unexported functions in the `crypt` and `lthn` packages, improving overall test coverage.

- Adds tests for the `ensureRSA` private function in `pkg/crypt/crypt.go`.
- Adds tests for the `createSalt` private function in `pkg/crypt/std/lthn/lthn.go`.

These changes align with the project's TDD methodology and follow the `_Good`, `_Bad`, `_Ugly` testing structure.
2025-11-02 21:23:13 +00:00