Skip to content

test(utils): add unit tests for GeneratePassword#5

Merged
lextpf merged 2 commits into
lextpf:mainfrom
Yokiatch:test/password-gen-unit-tests
May 14, 2026
Merged

test(utils): add unit tests for GeneratePassword#5
lextpf merged 2 commits into
lextpf:mainfrom
Yokiatch:test/password-gen-unit-tests

Conversation

@Yokiatch
Copy link
Copy Markdown
Contributor

Closes #3

Summary

Adds two unit tests for GeneratePassword() in tests/test_utils.cpp:

  • ClampsLength — verifies that lengths below 8 clamp to 8, above 128 clamp to 128, and a normal value (20) is preserved
  • UsesDocumentedCharset — generates a 64-character password and asserts every character belongs to the documented 76-character charset

Randomness is not made deterministic — the tests verify output properties only.

Test results

All 49 tests pass (.\ test.bat), up from 47 before this change.

@lextpf lextpf merged commit be13bd5 into lextpf:main May 14, 2026
0 of 3 checks passed
@lextpf
Copy link
Copy Markdown
Owner

lextpf commented May 14, 2026

Hi @Yokiatch ,

Thanks for jumping in so quickly, having another pair of eyes on this is always appreciated! 😊
Your changes look good and you have my approval! I'll merge this back ASAP

If you'd like to dive in deeper as a contributer:

The project is a bit opaque about where assets live and it's a bit tricky to set up your own assets which means runtime testing can be quite cumbersome, if you'd like to test locally yourself here are two easy ways to get you up and running in case you want to be more hands-on for future issues:

What you might need How to get it Notes
Full pre-built project from your branch ➜ Add me on Discord (@lextpf). Unzip anywhere and run the executable.
Only the assets (if you want to build yourself) ➜ Add me on Discord (@lextpf). After cloning the repo, drop the assets/ folder from this ZIP into the repo root, then build.

Let me know if you need support and we can arrange something, and thanks again for volunteering and helping improve Seal, you're always welcome to work on future issues! 🦭

Alex

@Yokiatch
Copy link
Copy Markdown
Contributor Author

I'll keep an eye on the repo and if something comes up that i can work upon , i'll contribute to that for sure.

@lextpf lextpf self-assigned this May 15, 2026
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 password generator length and charset tests

2 participants