Skip to content
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

Enhance KSUID Testing Suite #15

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vidhvath28
Copy link

Overview

This PR introduces a series of enhancements to the KSUID testing suite. It adds multiple new test cases to ensure the robustness and reliability of the KSUID implementation. The tests cover various edge cases and scenarios, helping to improve code quality and maintainability.

Changes Made

Added New Test Cases:

1. testFromInvalidPayload(): Validates behavior when an empty payload is provided.
2. testFromFutureTimestamp(): Ensures that generating a KSUID from a future timestamp functions correctly.
3. testGetValueConsistency(): Checks for consistent retrieval of the KSUID value.
4. testGetPayloadHexConversion(): Confirms that the payload matches its hex conversion.
5. testGetUnixTime(): Verifies that the Unix time corresponds with the provided timestamp.
6. testInspectFromInvalidLength(): Tests how the system responds to KSUIDs of invalid lengths.
7. testFromTimestampValidPayload(): Ensures that a KSUID created from a valid timestamp has a non-empty payload.

@gustavofreze
Copy link
Member

The only tests not currently accounted for are:

testFromFutureTimestamp: This ensures that generating a KSUID from a future timestamp functions correctly.
testFromTimestampValidPayload: This ensures that a KSUID created from a valid timestamp has a non-empty payload.
All other suggested tests are already covered in the current suite.

Therefore, the PR should be updated to include only these two new tests, following the pattern of the existing ones, and without altering the file's formatting.

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.

2 participants