-
Notifications
You must be signed in to change notification settings - Fork 71
Add Edge-Case Tests for DeserializePathElement #316
Copy link
Copy link
Open
Description
Background
As part of the migration to encoding/json/v2 in PR #292, we need to ensure that our deserialization logic remains robust and perfectly backward-compatible with the old json-iterator implementation.
Description
We need to develop new test cases to cover various edge scenarios for the DeserializePathElement function. This is critical to ensure robust error handling and correct behavior under unexpected inputs.
The scenarios that must be explicitly tested include:
- Zero-length input: How does the function handle an empty string?
- EOF conditions: What happens when the input stream unexpectedly ends?
- Leading or trailing whitespace: Ensure whitespace around the value is handled identically to the previous implementation.
- Multi-token inputs: Ensure inputs with multiple tokens fail as expected.
Goal
Capture the current behavior and prevent us from accidentally changing it. If these tests fail when we switch to json-iter (or json/v2), we'll be aware and can decide how to handle the differences the tests find.
Code Pointers
- File for New Tests:
fieldpath/serialize-pe_test.go - Function to Test:
DeserializePathElementinfieldpath/serialize-pe.go - Reference PR Comment: Discussion Link
Metadata
- Priority: P0
- Complexity: Easy
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels