This diff introduces tests for a validateUUIDv4 function from D4467 which validate generated UUIDs.
Details
Expected test results on run yarn test-tunnelbroker-service-in-sandbox.
Diff Detail
- Repository
- rCOMM Comm
- Branch
- add-validateuuid-tests
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
| services/tunnelbroker/test/ToolsTest.cpp | ||
|---|---|---|
| 44 ↗ | (On Diff #14250) | nit: maybe we could reuse the string from the previous case and just use a substring here? |
We can also add some tests with characters greater than f.
One really important test to add is a failing test with uppercase letters. We're implicitly assuming that all the clients will use lowercase letters for this id, so we should document it somewhere (as a test) to make it more explicit.
Rebase on stack changes.
Test on invalid format with character greater than F was added.
Test on an uppercase UUID format was added.
I've changed the invalid UUID to use a character greater than F instead of the invalid length. That makes more sense.
One really important test to add is a failing test with uppercase letters. We're implicitly assuming that all the clients will use lowercase letters for this id, so we should document it somewhere (as a test) to make it more explicit.
That makes sense to me. I've changed the regex in D4467 to match only the lowercase UUIDs and added the failing test for the uppercase UUID.
| services/tunnelbroker/test/ToolsTest.cpp | ||
|---|---|---|
| 44 ↗ | (On Diff #14250) |
On the updated version it was changed to use the wrong format with the character greater than F. |