tests: shunit2: add test for _jshn_append via JSON script - #30
Merged
Conversation
|
This adds tests for the manually merged #16. Now, one can easily see why that other PR is useful. Now I see a reason for merging that other PR and this one too. |
Noltari
approved these changes
Nov 13, 2025
Add another test which verifies _jshn_append leading space fix in commit 82cb5fd ("libubox: Drop extraneous space when appending values to variable") by appending keys to JSON objects, making sure there is no leading space on the first key when adding second key. test_jshn_append_via_json_script ASSERT:expected:<first> but was:< first> ASSERT:expected:<first second> but was:< first second> Tests: openwrt#16 Signed-off-by: Petr Štetiar <ynezz@true.cz> Link: openwrt#30 Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Noltari
force-pushed
the
ynezz/jshn-append-test
branch
from
November 17, 2025 18:31
29f067f to
a3ff29e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tests: shunit2: add test for _jshn_append via JSON script
Add another test which verifies _jshn_append leading space fix in commit
82cb5fd ("libubox: Drop extraneous space when appending values to
variable") by appending keys to JSON objects, making sure there is no
leading space on the first key when adding second key.
Tests: #16
tests: shunit2: add bash shebang to fix export -n error in dash
The test script was missing a shebang, causing it to be executed with
/bin/sh (often dash on Debian/Ubuntu systems). When the test sources
jshn.sh, which uses 'export -n', dash fails with:
Fix it by adding bash shebang.
https://github.com/ynezz/openwrt-libubox/actions/runs/19331703870/job/55296135170#step:9:34
Test results with 82cb5fd fix reverted