Commit c66f088
tests: lib: json: fix test expectation
Update the test_json_decoding test to expect correct unescaped values
based on descriptor type semantics:
- JSON_TOK_STRING: Stores pointer to original JSON string, preserving
escape sequences as they appear in the source. Used when the original
escaped format needs to be maintained.
- JSON_TOK_STRING_BUF: Copies and unescapes the string into a fixed-size
buffer, converting JSON escape sequences (\n, \t, \", etc.) to their
actual character equivalents. Used when the processed, unescaped string
is needed.
The test was incorrectly expecting the nested_string_buf field (which
uses JSON_TOK_STRING_BUF) to contain the escaped form "esc: \\t". With
the proper unescaping implementation, this field should contain the
unescaped version "esc: \t" (with actual tab character).
This aligns with the documented behavior where JSON_TOK_STRING_BUF
performs unescaping during the copy operation, while JSON_TOK_STRING
simply references the original escaped string.
Signed-off-by: BUDKE Gerson Fernando <gerson.budke@leica-geosystems.com>1 parent 66d13d7 commit c66f088
1 file changed
+1
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
554 | 554 | | |
555 | 555 | | |
556 | 556 | | |
557 | | - | |
558 | | - | |
| 557 | + | |
559 | 558 | | |
560 | 559 | | |
561 | 560 | | |
| |||
0 commit comments