libjansson Validation
Port build from safelibs/port-libjansson at commit 1ffb7dd38b33 (release build-1ffb7dd38b33)
Tests
Jansson array iteration sum Original / libjansson / array-iteration-sum Passed
Jansson malformed JSON error Original / libjansson / malformed-json-error Passed
Jansson object dump round trip Original / libjansson / object-dump-roundtrip Passed
Jansson pack and unpack values Original / libjansson / pack-unpack-values Passed
Jansson refcount object update Original / libjansson / refcount-object-update Passed
jshon walks a 2D array Original / libjansson / usage-jshon-2d-array-walk Passed
jshon array first string type Original / libjansson / usage-jshon-array-first-string-type-name Passed
Parses a JSON array with jshon, selects the first string element, and verifies the reported element type is string.
jshon array index Original / libjansson / usage-jshon-array-index Passed
jshon array last element Original / libjansson / usage-jshon-array-last-element Passed
jshon array root length Original / libjansson / usage-jshon-array-length-root Passed
jshon reports array length Original / libjansson / usage-jshon-array-length Passed
jshon array object second key Original / libjansson / usage-jshon-array-object-second-key Passed
jshon root array type Original / libjansson / usage-jshon-array-root-type Passed
jshon array second value Original / libjansson / usage-jshon-array-second-value Passed
jshon array root type Original / libjansson / usage-jshon-array-type-root Passed
jshon prints array values Original / libjansson / usage-jshon-array-values Passed
jshon array object second name Original / libjansson / usage-jshon-batch11-array-object-second-name Passed
jshon file nested number Original / libjansson / usage-jshon-batch11-file-nested-number Passed
jshon hyphen key field Original / libjansson / usage-jshon-batch11-hyphen-key-field Passed
jshon matrix row length Original / libjansson / usage-jshon-batch11-matrix-row-length Passed
jshon matrix value Original / libjansson / usage-jshon-batch11-matrix-value Passed
jshon negative number Original / libjansson / usage-jshon-batch11-negative-number Passed
jshon nested bool unstring Original / libjansson / usage-jshon-batch11-nested-bool-unstring Passed
jshon nested null type Original / libjansson / usage-jshon-batch11-nested-null-type Passed
jshon root array object field Original / libjansson / usage-jshon-batch11-root-array-object-field Passed
jshon slash string Original / libjansson / usage-jshon-batch11-slash-string Passed
jshon enumerates a 100-key object Original / libjansson / usage-jshon-big-object-100-keys Passed
Builds a JSON object with exactly 100 keys, then verifies jshon -l reports 100 and jshon -k emits 100 distinct key lines that match the constructed names.
jshon bool false type Original / libjansson / usage-jshon-bool-false-type Passed
Reads a false boolean field with jshon and verifies that the selected value reports the boolean type.
jshon bool true type Original / libjansson / usage-jshon-bool-true-type Passed
Reads a true boolean field with jshon and verifies that the selected value reports the boolean type.
jshon boolean array values Original / libjansson / usage-jshon-boolean-array-values Passed
jshon number field Original / libjansson / usage-jshon-count-field Passed
jshon deep array length Original / libjansson / usage-jshon-deep-array-length Passed
jshon deep extract then unstring Original / libjansson / usage-jshon-deep-extract-unstring Passed
Drills three levels into nested objects and arrays then prints the leaf value with -u stripped of quotes.
jshon deep extract with mixed object keys and array indices Original / libjansson / usage-jshon-deep-mixed-key-index Passed
Walks a four-level nested document by alternating object key extracts and array index extracts and verifies the leaf string value is reached intact.
jshon deep object keys Original / libjansson / usage-jshon-deep-object-keys Passed
jshon delete key roundtrip Original / libjansson / usage-jshon-delete-key-roundtrip Passed
Removes an object member with -d and confirms that key is absent from the keys listing while siblings remain.
jshon edit then extract chain Original / libjansson / usage-jshon-edit-extract-chain Passed
Deletes a key from a root object with -d, then extracts a sibling and unstrings its value within the same jshon invocation, asserting the chain produces the expected leaf and that the deleted key is absent from a follow-up keys listing.
jshon empty array length Original / libjansson / usage-jshon-empty-array-length Passed
jshon empty object length Original / libjansson / usage-jshon-empty-object-length Passed
jshon empty string field Original / libjansson / usage-jshon-empty-string-field Passed
jshon escaped newline string Original / libjansson / usage-jshon-escaped-newline-string Passed
Decodes an escaped newline string with jshon and verifies both decoded text lines are present in the output.
jshon escaped slash string Original / libjansson / usage-jshon-escaped-slash-string Passed
jshon escaped string Original / libjansson / usage-jshon-escaped-string Passed
Extracts a JSON string containing escape sequences with jshon and verifies the unescaped text is emitted.
jshon false field Original / libjansson / usage-jshon-false-field Passed
jshon file array length Original / libjansson / usage-jshon-file-array-length Passed
jshon file array object key Original / libjansson / usage-jshon-file-array-object-key Passed
jshon file array sum Original / libjansson / usage-jshon-file-array-sum Passed
jshon file empty object Original / libjansson / usage-jshon-file-empty-object Passed
jshon reads file input Original / libjansson / usage-jshon-file-input Passed
jshon file nested array length Original / libjansson / usage-jshon-file-nested-array-length Passed
jshon file nested label Original / libjansson / usage-jshon-file-nested-label Passed
jshon file nested object key Original / libjansson / usage-jshon-file-nested-object-key Passed
Reads a deeply nested object value from a JSON file with jshon and verifies the selected label string.
jshon file object keys Original / libjansson / usage-jshon-file-object-keys Passed
Reads a JSON object from a file with jshon and verifies the emitted key list contains both object keys.
jshon file root array Original / libjansson / usage-jshon-file-root-array Passed
jshon file root object Original / libjansson / usage-jshon-file-root-object Passed
jshon file root string value Original / libjansson / usage-jshon-file-root-string-value Passed
jshon file unicode label Original / libjansson / usage-jshon-file-unicode-label Passed
jshon file input matches stdin input Original / libjansson / usage-jshon-file-vs-stdin-equivalence Passed
jshon first record name Original / libjansson / usage-jshon-first-record-name Passed
jshon float field Original / libjansson / usage-jshon-float-field Passed
jshon fractional number value Original / libjansson / usage-jshon-fractional-number-value Passed
jshon insert at array back Original / libjansson / usage-jshon-insert-array-back Passed
Appends a new value to the end of a three-element array by inserting at the post-last index and verifies the inserted value lands at the new tail.
jshon insert at array front Original / libjansson / usage-jshon-insert-array-front Passed
Inserts a new value at index 0 of a three-element array using jshon -n value -i 0 and verifies the inserted value lands at index 0 while existing elements shift right.
jshon insert into array middle Original / libjansson / usage-jshon-insert-array-middle Passed
Inserts a new value at index 2 of a four-element array using jshon -n value -i 2 and verifies the inserted value lands at index 2 with elements after it shifted right.
jshon keys listing across object members Original / libjansson / usage-jshon-keys-listing-multiple Passed
jshon preserves a large integer Original / libjansson / usage-jshon-large-integer-preserved Passed
Reads a 15-digit integer member and verifies the digits round-trip through jshon -u without truncation.
jshon length on array object and string Original / libjansson / usage-jshon-length-three-shapes Passed
jshon nonexistent key exit status Original / libjansson / usage-jshon-missing-key-error-exit Passed
Confirms jshon -e on an absent object key exits with a nonzero status while a present key returns success.
jshon name field Original / libjansson / usage-jshon-name-field Passed
jshon negative number field Original / libjansson / usage-jshon-negative-number-field Passed
jshon negative number value Original / libjansson / usage-jshon-negative-number-value Passed
jshon nested array third value Original / libjansson / usage-jshon-nested-array-third-value Passed
Reads the third value from a nested JSON array with jshon and verifies the extracted numeric payload.
jshon nested array value Original / libjansson / usage-jshon-nested-array-value Passed
jshon nested empty array length Original / libjansson / usage-jshon-nested-empty-array-length Passed
jshon nested key list Original / libjansson / usage-jshon-nested-key-list Passed
jshon nested object field Original / libjansson / usage-jshon-nested-object-field Passed
jshon nested object key list Original / libjansson / usage-jshon-nested-object-key-list Passed
jshon nested object length Original / libjansson / usage-jshon-nested-object-length Passed
jshon nested object type Original / libjansson / usage-jshon-nested-type Passed
jshon extracts nested value Original / libjansson / usage-jshon-nested-value Passed
jshon null type Original / libjansson / usage-jshon-null-root-field-type Passed
jshon null type Original / libjansson / usage-jshon-null-type Passed
jshon number array values Original / libjansson / usage-jshon-number-array-sum Passed
jshon extracts number field Original / libjansson / usage-jshon-number-field Passed
jshon object array second type Original / libjansson / usage-jshon-object-array-second-type Passed
jshon object array third id Original / libjansson / usage-jshon-object-array-third-id Passed
Reads a field from the third object in an array with jshon and verifies the selected identifier.
jshon lists object keys Original / libjansson / usage-jshon-object-keys Passed
jshon object root length Original / libjansson / usage-jshon-object-length-root Passed
jshon object key count Original / libjansson / usage-jshon-object-length Passed
jshon object root type Original / libjansson / usage-jshon-object-type-root Passed
jshon pop returns to parent context Original / libjansson / usage-jshon-pop-parent-navigation Passed
Descends into a nested object with -e then uses -p to pop back and lists parent keys, verifying the keys belong to the outer object rather than the inner one.
chained jshon -d removes two keys and leaves the third intact Original / libjansson / usage-jshon-r10-delete-multiple-keys-leaves-remainder Passed
Applies two consecutive -d operations to a three-key object and verifies the resulting object contains exactly the remaining key with its original value preserved.
jshon -l on an empty object returns 0 Original / libjansson / usage-jshon-r10-empty-object-length-is-zero Passed
Reads {} and confirms that jshon -l reports the object length as exactly 0, distinct from the empty-array length case.
jshon -e accepts the empty string as an object key Original / libjansson / usage-jshon-r10-empty-string-key-extracted Passed
Reads an object whose sole key is the empty string, extracts the value with jshon -e "" -u, and verifies the value is recovered intact.
jshon -n null -i adds a null-valued key to an existing object Original / libjansson / usage-jshon-r10-insert-null-into-existing-object Passed
Inserts a JSON null using -n null -i into an object that already has one key and verifies the resulting object has both keys, with the new one typed as null.
jshon -n 42 -i adds a numeric key to an existing object Original / libjansson / usage-jshon-r10-insert-numeric-via-n-into-object Passed
Inserts the literal integer 42 with -n 42 -i count into an existing one-key object and verifies the new key is typed as number, the original key remains, and the unstrung value parses back to 42.
jshon -s value -i key adds a string entry to an empty object Original / libjansson / usage-jshon-r10-insert-string-builds-object-key Passed
Starts from an empty object, chains -s with -i to insert a string-valued key, and confirms the result is an object containing exactly that key with the expected unstrung value.
jshon -a -t emits one type per array element Original / libjansson / usage-jshon-r10-iter-array-types-each-line Passed
Iterates a heterogeneous array via jshon -a and applies -t to each element, verifying every element-level type appears on its own output line.
jshon -t reports number for scientific-notation literal Original / libjansson / usage-jshon-r10-number-exponent-type-is-number Passed
Parses a JSON value written with exponent notation (1e3) and confirms jshon -t reports the type as "number" rather than rejecting the literal or coercing to string.
jshon -p applied twice ascends to the grandparent Original / libjansson / usage-jshon-r10-pop-twice-yields-grandparent-keys Passed
Descends two levels into a nested object then issues two consecutive -p operations and lists keys, verifying the result lists the grandparent (root) keys rather than either intermediate scope.
jshon -s preserves an embedded double quote across roundtrip Original / libjansson / usage-jshon-r10-string-with-quote-via-s-roundtrip Passed
Inserts a string containing an embedded double quote via jshon -s into an object key, then extracts the value with -u and verifies the original byte sequence (including the quote) is recovered without escape leakage.
jshon -e -1 extracts the last element of an array Original / libjansson / usage-jshon-r11-array-extract-negative-one-last Passed
Reads an array of numeric literals and asserts that jshon -e -1 -u returns the final element, exercising the documented wrap-around behavior of negative array indexes for extract.
jshon -i append adds a value to the end of an array Original / libjansson / usage-jshon-r11-array-insert-append-keyword Passed
Starts from a 3-element array, pushes a string via -s, and inserts it with -i append; verifies the resulting array has length 4 and the new value lives at index 3.
jshon -n t inserts a JSON true value Original / libjansson / usage-jshon-r11-bool-abbreviation-t-yields-true Passed
Uses the documented one-character abbreviation -n t (and -n f) to insert booleans into an object; verifies both keys round-trip with the bool type and the unstring values true/false.
jshon -n '[]' creates an empty array literal Original / libjansson / usage-jshon-r11-bracket-syntax-creates-empty-array Passed
Asserts that jshon -n '[]' produces the empty-array sigil and that inserting it into an object yields a key whose value parses as an array of length 0.
jshon -F file -I -d key rewrites the file in place Original / libjansson / usage-jshon-r11-in-place-delete-key-rewrites-file Passed
Writes a two-key object to a file, runs jshon -F path -I -d key to delete one key in place, and verifies the file now parses to an object containing only the surviving key.
jshon -n object -i key creates an empty nested object Original / libjansson / usage-jshon-r11-insert-empty-object-creates-nested Passed
Starting from {}, uses -n object -i nested to add a key whose value is the empty object; verifies the parent has length 1 and the nested value parses as an object of length 0.
jshon -P strips jsonp callback wrapper before parsing Original / libjansson / usage-jshon-r11-jsonp-strip-extracts-payload Passed
Wraps a JSON object in a jsonp callback and verifies jshon -P unwraps it so the inner payload can be extracted via subsequent actions.
jshon -a -a -u maps unstring across leaves of a 2D array Original / libjansson / usage-jshon-r11-nested-across-twice-yields-leaves Passed
Iterates a 2x2 numeric matrix with two -a actions and -u, verifying the result is one leaf value per line in row-major order, exercising nested -a behavior.
jshon -S sorts keys recursively in nested objects Original / libjansson / usage-jshon-r11-sort-recurses-into-nested-objects Passed
Feeds a two-level object whose top-level and inner keys are both scrambled, and verifies jshon -S returns both layers with keys in lexicographic order.
jshon --version emits an 8-digit YYYYMMDD release date Original / libjansson / usage-jshon-r11-version-flag-yyyymmdd Passed
Invokes jshon --version and verifies stdout is a single 8-digit YYYYMMDD timestamp with stderr empty and exit zero, exercising the documented version banner format.
jshon -d 0 removes the first array element and shifts the rest Original / libjansson / usage-jshon-r12-delete-array-first-element Passed
Pipes a 4-element string array through jshon -d 0 and verifies the result has length 3 with the original second element now at index 0.
jshon -e key -u prints empty string for a JSON empty-string value Original / libjansson / usage-jshon-r12-empty-string-value-unstring Passed
Reads an object with a key whose value is the empty string and verifies jshon -e key -u outputs zero bytes while -e key -t reports the type as string.
jshon -e extracts a value via a key containing spaces Original / libjansson / usage-jshon-r12-extract-key-with-spaces Passed
Reads an object whose key is a multi-word string with spaces and verifies jshon -e "first name" -u returns the underlying value, exercising whitespace handling in extract paths.
jshon -i 0 inserts a string at the front of an array Original / libjansson / usage-jshon-r12-insert-into-array-at-zero Passed
Pipes a string through -s and inserts it into an array at position 0 with -i 0; verifies the resulting array starts with the inserted element and the original elements shift right.
jshon -k after -s value -i adds the new key to the listing Original / libjansson / usage-jshon-r12-keys-after-insert-includes-new Passed
Inserts a string value into an object via -s value -i newkey and verifies jshon -k afterwards lists the new key alongside the original keys.
jshon -l reports 1000 for a 1000-element integer array Original / libjansson / usage-jshon-r12-large-array-1000-length Passed
Generates a JSON array of 1000 integers, pipes it into jshon -l and verifies the reported length is exactly 1000, exercising the parser at moderate scale.
jshon -e a -e 1 -t reports object for nested array element Original / libjansson / usage-jshon-r12-nested-array-extract-then-type Passed
Reads an object with key "a" whose value is an array of mixed scalars and an object, and verifies jshon -e a -e 1 -t prints "object" for the second element.
jshon round-trips a simple integer array unchanged through stdin Original / libjansson / usage-jshon-r12-roundtrip-stable-output-array Passed
Feeds a canonical [1,2,3] integer array through jshon with no actions and verifies the output is equivalent JSON whose -l length is 3 and whose first element is 1.
jshon -u decodes JSON escaped backslash to single backslash Original / libjansson / usage-jshon-r12-string-with-backslash-roundtrip Passed
Reads a string value containing a JSON-escaped backslash and verifies jshon -u outputs the literal single backslash character.
jshon -e 0 returns the first element of an array Original / libjansson / usage-jshon-r12-zero-as-array-index Passed
Pipes a 3-element string array through jshon -e 0 -u and verifies the unstring output is the literal first string.
jshon -d 1 reduces a 5-element array to length 4 Original / libjansson / usage-jshon-r13-delete-shrinks-array-length Passed
Pipes a 5-element integer array through jshon -d 1 and verifies the resulting -l length is exactly 4 and the original element previously at index 2 has shifted to index 1.
jshon -e nums -t reports an array nested in a pre-built JSON object Original / libjansson / usage-jshon-r13-insert-array-into-object-creates-nested-array Passed
Feeds jshon a pre-built JSON document {"nums":[1,2,3]} on stdin and verifies -e nums -t reports "array", -e nums -l reports length 3, and -e nums -e 0 -u recovers the first element. (Noble's jshon rejects both '-n [1,2,3]' as a literal stack value AND the chained '-n [] -i nums -e nums -n 1 -a -p' build sequence with "type not mappable"; deserialising a pre-built object is the documented stable surface.)
jshon -s a 1024-character string and -e -u recovers it intact Original / libjansson / usage-jshon-r13-large-string-1024-roundtrip Passed
Builds an object with a single 1024-character ASCII string value via jshon -s value -i blob, then extracts it back with -e blob -u and verifies the recovered byte sequence matches the original byte-for-byte.
jshon -a -t emits a per-element type line for a mixed-type array Original / libjansson / usage-jshon-r13-mixed-array-across-prints-types-per-line Passed
Pipes a 4-element array containing one of each scalar shape (string, number, boolean, null) through jshon -a -t and verifies stdout contains exactly the four lines "string", "number", "bool", "null" in order, exercising iteration plus type printing.
jshon -e 123 on object with numeric-string key returns the string value Original / libjansson / usage-jshon-r13-numeric-string-key-extracted-string-type Passed
Reads an object whose key is the numeric-looking string "123" and verifies jshon -e 123 -t reports the value type as string and -u prints the literal value, exercising key lookup by digit-only token in object context.
jshon -e child -p -k at a nested object lists the parent keys Original / libjansson / usage-jshon-r13-pop-after-extract-yields-parent-keys Passed
Reads a parent object with two keys (one of which is itself an object), extracts the nested child, pops back with -p, and verifies -k afterwards lists exactly the original parent keys.
jshon prepends three values via repeated -i 0 in the expected reversed order Original / libjansson / usage-jshon-r13-prepend-three-times-final-order Passed
Starts from an empty array and prepends three string values "x" then "y" then "z" via jshon -s and -i 0 chained three times, then verifies the resulting array has length 3 and the elements appear in the order ["z","y","x"].
jshon -i append three times grows an array from 0 to length 3 Original / libjansson / usage-jshon-r13-three-appends-grow-array-length Passed
Starts from the empty array and chains three -s value -i append pairs through jshon, verifying the resulting array has length 3 and the trailing element matches the most recent append.
jshon builds a 3-key object by chaining three -s/-i pairs Original / libjansson / usage-jshon-r13-three-keys-via-chained-insert Passed
Starts from an empty object and chains -s "1" -i a -s "2" -i b -s "3" -i c through jshon to build a 3-key object, then verifies -k lists exactly the keys a, b, c (sorted) and -l reports length 3.
jshon -e a -e b -e c -u walks three nested objects to a leaf string Original / libjansson / usage-jshon-r13-three-level-extract-unstring Passed
Reads a JSON object nested three levels deep with a string leaf and verifies jshon -e a -e b -e c -u prints exactly the leaf payload, exercising chained extract through three object levels.
jshon -a -e id -u prints the id field from each object in an array Original / libjansson / usage-jshon-r14-across-extract-id-from-array-of-objects Passed
Pipes an array of three objects each carrying an "id" field through jshon -a -e id -u and verifies stdout contains exactly the three id values "1", "2", "3" in order, exercising the across operator combined with extraction.
jshon -e 1 -l after array extract reports nested array length Original / libjansson / usage-jshon-r14-array-extract-then-length-of-nested Passed
Pipes an array containing a nested 4-element array as its second element through jshon -e 1 -l and verifies the reported length is exactly 4, exercising chained extract followed by length on nested array context.
jshon -a -t on a homogeneous integer array yields four "number" lines Original / libjansson / usage-jshon-r14-array-of-numbers-across-types-all-number Passed
Pipes a 4-element integer array through jshon -a -t and verifies stdout contains exactly four lines each equal to the literal "number", exercising the across-iterator paired with type printing on a homogeneous numeric array.
jshon -d on an object key removes it from the -k listing Original / libjansson / usage-jshon-r14-delete-object-key-removes-from-keys Passed
Pipes a three-key object through jshon -d middle and verifies the resulting -k listing contains exactly "first" and "last" (sorted), exercising the documented delete operator on object keys.
jshon -e arr -e 0 -p -l after extract-pop reports parent array length Original / libjansson / usage-jshon-r14-extract-array-then-pop-back-to-array Passed
Pipes an object containing a 4-element array under key "arr" through jshon -e arr -e 0 -p -l, popping back to the array context, and verifies the reported length is exactly 4, exercising pop after a nested extract.
jshon -e a -p -k after extract and pop lists the root keys Original / libjansson / usage-jshon-r14-extract-then-pop-yields-original-keys Passed
Pipes a two-key root object through jshon -e a -p -k and verifies the popped context lists exactly the original root keys "a" and "b" (sorted), exercising the documented round-trip extract-then-pop navigation.
jshon -n true -i flag adds a boolean-true value under a new key Original / libjansson / usage-jshon-r14-insert-bool-true-into-object Passed
Starts from an empty object and chains -n true -i flag through jshon to add a boolean-true value under the key "flag", then verifies the resulting -e flag -t reports "bool" and -e flag -u prints the literal "true".
jshon -k on a 3-key object lists exactly three keys Original / libjansson / usage-jshon-r14-keys-listing-deterministic-three Passed
Pipes a three-key object through jshon -k and verifies the output contains exactly three lines whose sorted contents equal "alpha", "beta", "gamma", confirming the documented key listing behaviour.
jshon parses and reprints a 3-level nested object preserving the leaf Original / libjansson / usage-jshon-r14-roundtrip-deeply-nested-three-levels Passed
Pipes a 3-level nested object through jshon (no transforms) and verifies the resulting output, when re-parsed, still extracts the same leaf value via jshon -e a -e b -e c -u, exercising idempotent reprinting through three levels.
jshon -s with a UTF-8 snowman roundtrips intact through -e -u Original / libjansson / usage-jshon-r14-string-with-unicode-snowman-roundtrip Passed
Builds an object with a single value containing the UTF-8 snowman character via jshon -s value -i icon, then extracts it back with -e icon -u and verifies the recovered byte sequence equals the original UTF-8 encoding.
jshon -a -u unstrings every element of a string array onto its own line Original / libjansson / usage-jshon-r15-across-array-of-strings-unstring-each Passed
Pipes a four-element string array through jshon -a -u and verifies stdout contains exactly the four raw values "alpha", "beta", "gamma", "delta" in order with no surrounding quotes, exercising the documented across operator combined with unstring.
jshon -a -t prints the JSON type of each element of a mixed array Original / libjansson / usage-jshon-r15-across-mixed-types-prints-types-per-line Passed
Pipes a six-element mixed-type array through jshon -a -t and verifies stdout contains the documented type names number, string, bool, null, array, object exactly in that order, one per line, exercising the across operator combined with type extraction.
jshon -n 99 -i append adds a number to the end of an existing array Original / libjansson / usage-jshon-r15-append-numeric-via-n-into-array-end Passed
Pipes a 3-element numeric array through jshon -n 99 -i append and verifies the resulting array has length four with the literal 99 at the last position, exercising the documented append insertion mode for arrays via the -i append keyword.
jshon chains three -d deletes and reports length one with the remaining key Original / libjansson / usage-jshon-r15-delete-three-keys-leaves-one Passed
Pipes a 4-key object through three chained -d deletes and verifies the resulting object reports length one and the surviving key when listed via -k, exercising the documented chained deletion behaviour.
jshon -e nested -k lists the keys of a nested object Original / libjansson / usage-jshon-r15-extract-then-keys-of-nested-object Passed
Pipes an object with a nested object under key "nested" through jshon -e nested -k and verifies stdout contains exactly the three nested keys "x", "y", "z" in source order, exercising extract followed by key enumeration.
jshon -n array -i creates a new array-typed key on an existing object Original / libjansson / usage-jshon-r15-insert-array-via-n-into-object Passed
Pre-builds a fresh empty array via -n array on the stack and chains -i items into a one-key object, then verifies the resulting object reports type "array" under the new key, has length two, and preserves the original key, exercising the documented stack-driven array insertion pattern.
jshon -n object -i creates a new empty-object-typed key on an existing object Original / libjansson / usage-jshon-r15-insert-object-via-n-into-object Passed
Pre-builds a fresh empty object via -n object on the stack and chains -i child into a one-key object, then verifies the resulting object reports type "object" under the new key with zero internal keys and length two at the root, exercising the documented stack-driven object insertion pattern.
jshon -e a -e b -e c -p -k lists parent-of-c keys after pop Original / libjansson / usage-jshon-r15-pop-after-deep-extract-yields-parent Passed
Pipes a three-level nested object through jshon -e a -e b -e c -p -k, popping back to the b-level container, and verifies the listed keys are exactly the keys of b ("c"), exercising pop after a deep extract chain.
jshon -n 0 -i 0 prepends a number at index zero of an existing array Original / libjansson / usage-jshon-r15-prepend-numeric-via-n-into-array-front Passed
Pipes a 3-element numeric array through jshon -n 0 -i 0 and verifies the resulting array has length four with the literal 0 at index zero and the original first element shifted to index one, exercising the documented index-zero insertion mode.
jshon -s "key=value" -i tag preserves an equals-sign string through extract Original / libjansson / usage-jshon-r15-string-with-equals-sign-roundtrip Passed
Pre-builds a string containing an equals sign via -s "key=value" on the stack, inserts it under "tag" into a one-key object, and verifies the unstrung value extracted via -e tag -u equals the literal "key=value", exercising the documented string roundtrip.
jshon -e 0 -u extracts the first element of a string array Original / libjansson / usage-jshon-r16-array-index-zero-extract-unstring Passed
Pipes a three-element string array through jshon -e 0 -u and asserts stdout equals "first" exactly, exercising libjansson's array-by-integer-index lookup followed by JSON-string unescape.
jshon -e a -e b -u extracts a two-level nested string value Original / libjansson / usage-jshon-r16-extract-nested-two-levels-unstring Passed
Pipes a small object {"a":{"b":"deep"}} through jshon -e a -e b -u and asserts the printed value is exactly "deep" with no surrounding quotes, exercising libjansson's nested object navigation through two -e steps followed by -u (unstring).
jshon -e then -p restores parent object and reports type "object" Original / libjansson / usage-jshon-r16-extract-then-parent-back-to-object Passed
Pipes an object {"k":"v"} into jshon -e k -p -t and asserts stdout equals "object", exercising the documented parent navigation: extract a leaf then -p pops back to the original object whose type is "object".
jshon reads JSON from stdin redirect and extracts a string value via -e -u Original / libjansson / usage-jshon-r16-file-redirect-extract-string-value Passed
Writes a small JSON object to a temporary file, redirects it to jshon -e name -u, and asserts stdout equals "r16-fixture" exactly, exercising libjansson's file-redirect parse path through the documented -e/-u extraction chain.
jshon -l reports 3 for an object with three keys Original / libjansson / usage-jshon-r16-length-of-three-key-object Passed
Pipes an object with three top-level keys through jshon -l and asserts the printed length is exactly "3", exercising libjansson's object length reflection (number of immediate keys) through the documented -l operator.
jshon -s wraps a raw text payload into a quoted JSON string literal Original / libjansson / usage-jshon-r16-string-wrap-text-into-json-string Passed
Pipes the empty input through jshon -s hello-r16 and asserts stdout is exactly the seven-character payload wrapped in JSON double quotes ("hello-r16"), exercising libjansson's string-serialiser invoked through the documented -s wrap operator.
jshon round-trips an object whose key contains a UTF-8 snowman Original / libjansson / usage-jshon-r16-utf8-key-roundtrip-preserved Passed
Pipes an object whose key is the UTF-8 snowman U+2603 through jshon (no operators) and asserts the round-tripped output contains both the snowman byte sequence and the string value, exercising libjansson's UTF-8 preservation for object keys.
jshon -e a -e b -u extracts deep string from two-level object Original / libjansson / usage-jshon-r17-chained-unstring-two-keys Passed
Pipes {"k1":{"k2":"final"}} through jshon -e k1 -e k2 -u and asserts the unwrapped stdout equals "final" exactly, exercising libjansson's chained extract-then-unstring with explicit key names k1/k2 (distinct from r16 a/b and r17 parent/child variants).
jshon -k on a two-key object emits both key names Original / libjansson / usage-jshon-r17-keys-of-two-key-object Passed
Pipes an object with exactly two keys "alpha" and "omega" through jshon -k and asserts the captured output contains both key names on separate lines (alpha and omega), exercising libjansson's object key enumeration with a small explicit-key fixture.
jshon -l on an empty array root reports length 0 Original / libjansson / usage-jshon-r17-length-of-empty-array-zero Passed
Pipes the two-character empty-array literal [] through jshon -l and asserts stdout equals "0" exactly, exercising libjansson's array length reflection for the boundary case of an empty container.
jshon -l reports 5 for a five-element integer array Original / libjansson / usage-jshon-r17-length-of-five-element-array Passed
Builds a five-element integer array via jshon -n array followed by five -n N -i append steps and asserts jshon -l reports exactly "5", exercising libjansson's array length reflection (distinct from the r16 three-key object length test) using an array root.
jshon roundtrip object via -e -u and back through jshon -t reports number Original / libjansson / usage-jshon-r17-roundtrip-object-via-stringify Passed
Extracts a numeric leaf from {"n":42} via jshon -e n -u then pipes the resulting "42" through a fresh jshon root that re-parses it as a JSON number scalar... but jshon rejects scalar roots on noble, so instead this test verifies that the extracted number unwrapped via -u equals "42" and re-running jshon -e n -t on the same object reports type "number".
jshon -e parent -e child two-level navigation yields child string Original / libjansson / usage-jshon-r17-two-level-extract-via-parent-keys Passed
Pipes an object {"parent":{"child":"leaf"}} through jshon -e parent -e child -u and asserts stdout is exactly "leaf", exercising libjansson's two-step object navigation with distinct key names from the r16 a/b test.
jshon -n array -t reports array type for a freshly constructed empty array Original / libjansson / usage-jshon-r17-type-array-root-from-jshon-n Passed
Constructs a brand-new empty array via jshon -n array, pipes it back into jshon -t, and asserts stdout equals "array" exactly, exercising libjansson's empty-array construction and type reflection through the documented -n array idiom.
jshon -t on an empty object root reports type "object" Original / libjansson / usage-jshon-r17-type-object-root Passed
Pipes the two-character empty-object literal {} through jshon -t and asserts stdout equals "object" exactly, exercising libjansson's empty-object type reflection through the documented -t operator at the root.
jshon -e key -t on a string-valued field reports type "string" Original / libjansson / usage-jshon-r17-type-of-extracted-string-value Passed
Pipes the object {"name":"validator"} through jshon -e name -t and asserts stdout equals "string" exactly, exercising libjansson's type reflection on an extracted scalar leaf (distinct from the r16 -p parent test).
jshon -e -1 -u on a four-element string array yields the last element Original / libjansson / usage-jshon-r18-array-extract-negative-one-last Passed
Pipes ["alpha","beta","gamma","delta"] through jshon -e -1 -u and asserts stdout equals "delta" exactly, exercising libjansson's negative-index-from-end semantics in jshon's -e operator with a distinct fixture from r11 negative-one coverage.
jshon -e 1 -u on an array of strings yields the second element unwrapped Original / libjansson / usage-jshon-r18-array-of-strings-second-element-unstring Passed
Pipes ["zero","one","two","three"] through jshon -e 1 -u and asserts stdout equals "one" exactly, exercising libjansson's zero-indexed array element extraction at index 1 followed by string unwrap through the -u operator.
jshon -d on a three-key object then -k reports the two surviving keys Original / libjansson / usage-jshon-r18-delete-key-shrinks-keys-list Passed
Pipes {"a":1,"b":2,"c":3} through jshon -d b followed by -k and asserts the captured output lists exactly the two surviving keys "a" and "c" (no "b"), exercising libjansson's object-key deletion followed by key enumeration on the modified object.
jshon -n number -i count inserts a JSON number and extracts it as type number Original / libjansson / usage-jshon-r18-insert-number-into-object-via-n Passed
Starts with empty object {}, inserts the JSON number 1337 under key "count" via jshon -n 1337 -i count, then runs -e count -t and asserts stdout equals "number" exactly, exercising libjansson's numeric insert-into-object path and the type round-trip distinct from -s string coverage.
jshon -s value -i key inserts a string into an object and extracts it back Original / libjansson / usage-jshon-r18-insert-string-into-object-then-extract Passed
Starts with empty object {}, inserts the string "hello" under key "greet" via jshon -s hello -i greet, then re-extracts via -e greet -u and asserts the recovered value equals "hello" exactly, exercising libjansson's string insert-into-object path through the documented -s/-i chain.
jshon -k on a three-key object emits exactly three key-name lines Original / libjansson / usage-jshon-r18-keys-of-three-key-object-line-count Passed
Pipes an object with three keys "red", "green", "blue" through jshon -k, captures the output, and asserts the line count is exactly 3 and that each key name appears once, exercising libjansson's three-element object key enumeration with explicit named keys (distinct from r17 two-key coverage).
jshon -l reports 7 for a seven-element mixed array Original / libjansson / usage-jshon-r18-length-of-seven-element-array Passed
Pipes the JSON literal [1,2,3,4,5,6,7] through jshon -l and asserts stdout equals "7" exactly, exercising libjansson's array length reflection on a longer single-line literal array than existing r17 five-element coverage.
jshon -e child -p -k after extract+pop yields the parent object keys Original / libjansson / usage-jshon-r18-pop-after-extract-yields-keys Passed
Pipes {"parent":{"child":42},"sibling":"x"} through jshon -e parent -e child -p -p -k and asserts the captured output contains exactly the two parent-level keys "parent" and "sibling", exercising libjansson's parent-walk via -p after a chained -e descent.
jshon -e key -t on an object whose value is true reports type "bool" Original / libjansson / usage-jshon-r18-type-of-extracted-bool-true Passed
Pipes {"flag":true} through jshon -e flag -t and asserts stdout equals "bool" exactly, exercising libjansson's boolean-typed value extraction and type reflection (jshon reports the JSON true literal as type bool, distinct from null/number/string).
jshon -e key -t on an object whose value is null reports type "null" Original / libjansson / usage-jshon-r18-type-of-extracted-null-value Passed
Pipes {"x":null} through jshon -e x -t and asserts stdout equals "null" exactly, exercising libjansson's null-typed value extraction and type reflection through chained -e/-t operators (distinct from -e key -u which would not apply to null).
jshon -e 0 -u on a four-element string array yields the first element Original / libjansson / usage-jshon-r19-array-extract-zero-first Passed
Pipes ["alpha","beta","gamma","delta"] through jshon -e 0 -u and asserts stdout equals "alpha" exactly, exercising libjansson's zero-based positive-index semantics in jshon's -e operator with a fixture distinct from earlier negative-index r18 coverage.
jshon -e 1 -e name -u on an array of objects yields the second object's name Original / libjansson / usage-jshon-r19-array-of-objects-second-field-extract Passed
Pipes [{"name":"alpha"},{"name":"beta"},{"name":"gamma"}] through jshon -e 1 -e name -u and asserts stdout equals "beta" exactly, exercising libjansson's chained -e descent through an array index into an object field in a single jshon invocation.
jshon -d 1 on a four-element array reduces -l to 3 Original / libjansson / usage-jshon-r19-delete-second-array-element-length Passed
Pipes ["a","b","c","d"] through jshon -d 1 followed by -l and asserts the captured length equals "3" (libjansson removes index 1 and the array becomes ["a","c","d"]), exercising libjansson's array-element deletion path through jshon's -d on a numeric index.
jshon -n true -i flag inserts a JSON boolean and extracts it as type bool Original / libjansson / usage-jshon-r19-insert-bool-true-into-object Passed
Starts with empty object {}, inserts the JSON boolean true under key "flag" via jshon -n true -i flag, then runs -e flag -t and asserts stdout equals "bool" exactly, exercising libjansson's boolean insert-into-object path through jshon's -n raw-JSON insertion.
jshon -k on a five-key object emits exactly five key-name lines Original / libjansson / usage-jshon-r19-keys-of-five-key-object-line-count Passed
Pipes an object with five keys "one"..."five" through jshon -k, captures the output, and asserts the line count is exactly 5 and that each key name appears once, exercising libjansson's five-element object key enumeration with explicit named keys (distinct from r18 three-key coverage).
jshon -l on an eleven-element integer array reports 11 Original / libjansson / usage-jshon-r19-length-of-eleven-element-array Passed
Pipes [0,1,2,3,4,5,6,7,8,9,10] through jshon -l and asserts stdout equals "11" exactly, exercising libjansson's array-length reporting at a length distinct from earlier r17/r18 fixtures and across a single-digit-to-two-digit transition.
jshon -e items -e 0 -p -p -e items -l reports the original array length Original / libjansson / usage-jshon-r19-pop-after-array-extract-yields-length Passed
Pipes {"items":[10,20,30,40,50]} through jshon -e items -e 0 -p -p -e items -l and asserts stdout equals "5" exactly, exercising libjansson's chained parent-walk (-p) after a double descent followed by re-extracting the array and asking for its length.
jshon -e flag -t on {"flag":false} returns bool Original / libjansson / usage-jshon-r19-type-of-extracted-bool-false Passed
Pipes {"flag":false} through jshon -e flag -t and asserts stdout equals "bool" exactly, exercising libjansson's type classification of the JSON false literal extracted from an object (distinct from the r18 true-value coverage).
jshon -e k -t on a fractional number returns number Original / libjansson / usage-jshon-r19-type-of-extracted-number-fractional Passed
Pipes {"k":3.14} through jshon -e k -t and asserts stdout equals "number" exactly, exercising libjansson's type classification of an extracted JSON fractional number (jshon collapses int and real JSON types into the unified "number" label).
jshon -e on a key with a Unicode escape returns the expected string value Original / libjansson / usage-jshon-r19-unicode-key-extract-value Passed
Pipes {"étoile":"star"} through jshon -e $'étoile' -u and asserts the unwrapped result equals "star" exactly, exercising libjansson's parsing of \u escapes in object keys followed by jshon's UTF-8 key lookup on the resulting in-memory object.
jshon -a -t reports the four element types of a mixed-type array Original / libjansson / usage-jshon-r20-across-types-of-mixed-array-elements Passed
Pipes [true,1,"x",null] through jshon -a -t and asserts the four output lines are exactly "bool", "number", "string", "null" in order, exercising libjansson's value-type enumeration via jshon's across-map and type-name reporting on a four-element mixed array.
jshon -s value -i append on a three-element array grows length to four Original / libjansson / usage-jshon-r20-append-string-into-three-element-array-length Passed
Starts with the array [1,2,3], creates a JSON string "tail" with -s, inserts it at index append via -i, and asserts the resulting array has length 4, exercising libjansson's array growth via jshon's append-keyword insertion path.
jshon -C -e missing -t reports the type "null" for a missing key under continue mode Original / libjansson / usage-jshon-r20-continue-flag-missing-key-yields-null-type Passed
Pipes {"a":1} through jshon -C -e nonexistent -t and asserts the printed type is "null", exercising libjansson's value model when jshon's continue flag substitutes a null sentinel for a missing object key rather than aborting.
jshon -d 3 on a four-element array reduces its length to three Original / libjansson / usage-jshon-r20-delete-highest-index-shrinks-array Passed
Pipes [10,20,30,40] through jshon -d 3 -l and asserts the resulting length is 3, exercising libjansson's array length tracking when jshon deletes the highest-indexed element by explicit numeric index distinct from earlier rounds' coverage of front-index deletion.
jshon -S -e nested -k emits the nested object keys in alphabetical order Original / libjansson / usage-jshon-r20-extract-then-sort-keys-alphabetical Passed
Pipes an object containing a nested object with three keys defined out-of-order through jshon -S to sort recursively, then extracts the nested object and prints its keys with -k, asserting the keys appear in alphabetical order, exercising libjansson's object representation under jshon's sort and extract chain.
jshon -F path -l reports the five-element array length when reading from a file Original / libjansson / usage-jshon-r20-file-flag-reads-array-length-five Passed
Writes [1,2,3,4,5] to a tempfile, runs jshon -F <path> -l, and asserts the printed length is 5, exercising libjansson's file-based JSON load path through jshon's -F non-manipulation flag with stdin closed.
jshon -n value -i key then -e key -u returns the inserted number as a string Original / libjansson / usage-jshon-r20-insert-number-then-extract-confirms-value Passed
Starts with the object {"a":1}, creates a JSON number 42 via -n, inserts it at key "b", then re-extracts -e b -u and asserts the result is "42", exercising libjansson's number value round-trip through jshon's nonstring/insert/extract chain.
jshon -e -1 -u returns the last array element's unstrung value Original / libjansson / usage-jshon-r20-negative-index-extract-last-array-value Passed
Pipes ["alpha","beta","gamma"] through jshon -e -1 -u and asserts the result is "gamma", exercising libjansson's array wraparound indexing via jshon's negative-index extraction.
jshon -e key -e key -l reports the length of a doubly-nested inner array Original / libjansson / usage-jshon-r20-nested-array-length-via-two-extracts Passed
Pipes {"a":{"b":[10,20,30,40,50]}} through jshon -e a -e b -l and asserts the printed length is 5, exercising libjansson's nested container traversal via jshon's chained extract followed by length-of-array.
jshon -Q -e missing emits empty stderr and a non-zero exit on a missing key Original / libjansson / usage-jshon-r20-quiet-flag-suppresses-stderr-on-missing-key Passed
Pipes {"a":1} through jshon -Q -e nonexistent capturing stderr, asserts the captured stderr is empty (quiet mode suppresses the diagnostic), and asserts the exit status is non-zero, exercising libjansson's lookup-miss path through jshon's quiet error-suppression flag.
jshon -a -e v -u emits the v field of each object in an array on separate lines Original / libjansson / usage-jshon-r21-across-array-of-objects-extract-each-v Passed
Pipes a JSON array of three objects each carrying a numeric "v" field through jshon -a -e v -u and asserts the captured output consists of exactly three lines with the values "10", "20", "30" in that order - locking in libjansson-backed jshon's across-then-extract pipeline that iterates an array and projects a per-element field.
jshon default output of a single-key object emits one space after the colon per line Original / libjansson / usage-jshon-r21-default-output-compact-no-spaces Passed
Pipes the JSON object {"k":1} through jshon (no flags) and asserts the captured output exactly equals the three-line representation "{\n \"k\": 1\n}\n" - locking in libjansson-backed jshon's default reformatting output: keys indented by a single space, a colon-space delimiter between key and value, and braces on their own lines.
jshon -e on an object with duplicate keys returns the last-defined value Original / libjansson / usage-jshon-r21-duplicate-key-last-wins Passed
Pipes a JSON object literal containing two entries with the same key "a" (mapped to 1 and 3 respectively) through jshon -e a -u and asserts the captured value equals exactly "3" - locking in libjansson's documented duplicate-key resolution where the later definition supersedes the earlier one in the parsed object.
jshon -F on a non-existent path exits nonzero with a stderr file-error message Original / libjansson / usage-jshon-r21-f-flag-missing-file-error Passed
Runs jshon -F /nonexistent/path against an unwritable path that cannot exist, captures stderr, asserts the exit code is nonzero and that the captured stderr contains both "unable to read file" and the literal target path - locking in libjansson-backed jshon's file-mode error reporting when the requested input is missing.
jshon -n "[]" -i empty creates an empty-array entry observable via -k Original / libjansson / usage-jshon-r21-insert-empty-array-then-keys Passed
Starts from an empty JSON object {}, pipes it through jshon -n "[]" -i empty -k to insert an empty array under key "empty" and then list the parent keys, asserts the captured single-line output equals exactly "empty" - locking in libjansson-backed jshon's pipeline for inserting a fresh empty array into an empty object via the -n container literal.
jshon -P strips jsonp wrapper around an array and -e extracts the second element Original / libjansson / usage-jshon-r21-jsonp-strip-array-payload Passed
Wraps a JSON array of three strings inside a "callback(...)" jsonp envelope, pipes it through jshon -P -e 1 -u, and asserts the captured output equals exactly "middle" - locking in libjansson's parser invocation after jshon's jsonp-strip pass when the inner payload is an array (the existing r11 jsonp test only covered an object payload).
jshon extracts an object value addressed by a key containing internal spaces Original / libjansson / usage-jshon-r21-key-with-spaces-extract-value Passed
Pipes a JSON object with the key "hello world" mapped to the integer 42 through jshon -e "hello world" -u and asserts the captured output equals exactly "42" - locking in libjansson's exact key matching when the key contains an internal ASCII space (existing r12 only covered the "key with spaces" extracted as a string value, not the integer-value path with an internal-space key).
jshon extracts the integer 9007199254740992 (2^53) without precision loss Original / libjansson / usage-jshon-r21-large-integer-2pow53-roundtrip Passed
Pipes the JSON array [9007199254740992] through jshon -e 0 -u and asserts the captured output equals exactly "9007199254740992" - locking in libjansson's integer parsing/round-tripping at the IEEE-754 double 2^53 boundary, well above prior tests that exercised only smaller large-integer values.
jshon -0 -a -u emits NUL-separated unstring tokens for an array of strings Original / libjansson / usage-jshon-r21-null-delimited-array-strings Passed
Pipes a JSON array of three short strings ["alpha","beta","gamma"] through jshon -0 -a -u and asserts the resulting byte stream is exactly the three strings each followed by a NUL byte (no trailing newline) - locking in libjansson-backed jshon's NUL-delimited emission mode when un-stringing across an array.
jshon -V validates well-formed input, exits zero, and reprints it Original / libjansson / usage-jshon-r21-v-validate-prints-input-and-zero-exit Passed
Pipes the JSON object {"a":1,"b":[true,null]} through jshon -V and asserts the command exits zero AND that the captured stdout contains "a", "b", "true", and "null" - locking in libjansson-backed jshon's -V validate path that confirms structural well-formedness while still re-emitting the parsed document.
jshon builds an array from scratch via -n -s -n -i append chaining Original / libjansson / usage-jshon-r3-build-array-incrementally Passed
Starts from an empty array via jshon -n '[]' and appends a string, a number, a boolean, and a null in sequence with repeated -s/-n + -i append, then verifies the final array length and the type of each appended element.
jshon -e on keys containing backslash, tab, and quote escape sequences Original / libjansson / usage-jshon-r3-escape-sequences-keys Passed
Constructs an object whose keys contain a JSON-escaped backslash, a JSON-escaped tab, and a JSON-escaped double quote, then asserts jshon -e accepts the decoded raw key strings and returns the matching values.
jshon -e walks five levels of nesting Original / libjansson / usage-jshon-r3-five-level-nested-extract Passed
Builds a JSON document nested five object levels deep and verifies jshon -e returns the matching subtree at every level, with the leaf -u producing the final string and intermediate -t reporting object at each level.
jshon -l counts a 200-element array Original / libjansson / usage-jshon-r3-large-array-200 Passed
Constructs a JSON array containing exactly 200 integers and verifies jshon -l reports 200, jshon -e at the boundary indices returns the expected values, and jshon -t reports array.
jshon walks object then array then object then key Original / libjansson / usage-jshon-r3-mixed-deep-walk Passed
Drills through an object that holds an array of objects, picks one entry by index, then extracts a leaf string key on the inner object and verifies the unstringed leaf as well as intermediate types.
jshon -t reports the right type for each element of a mixed-type array Original / libjansson / usage-jshon-r3-mixed-scalar-array-types Passed
Loads an array whose elements span string, number, true, false, and null, then asserts jshon -t at each index returns the type label that matches the underlying JSON scalar.
jshon -e on object keys that are numeric strings Original / libjansson / usage-jshon-r3-numeric-string-keys Passed
Builds an object whose keys are the string forms of integers ("1","2","3") and verifies jshon -e treats them as ordinary string keys, not array indices, returning the associated values via -u.
jshon -u prints numeric values without quotes Original / libjansson / usage-jshon-r3-unstring-number Passed
Applies jshon -u to integer, negative, fractional, and scientific JSON number values and verifies the bare digit form is emitted on stdout exactly as in the source document.
jshon -e on an object key containing whitespace Original / libjansson / usage-jshon-r3-whitespace-key Passed
Defines an object with a key that contains a literal space and asserts jshon -e accepts the key as a single argument and returns the matching value.
jshon -k piped through xargs back into jshon -e Original / libjansson / usage-jshon-r3-xargs-extract-keys Passed
Lists object keys with jshon -k, pipes them through xargs into a fresh jshon -e invocation per key, and confirms each per-key extraction returns the expected unstringed value.
jshon -e walks object then array index then field Original / libjansson / usage-jshon-r4-data-array-id-extract Passed
Builds {"data":[{"id":1},{"id":2}]} and verifies jshon -e data -e 1 -e id -u returns 2 while -e data -e 0 -e id -u returns 1, exercising mixed object/array descent at varying indices.
jshon -d removes an array element by position Original / libjansson / usage-jshon-r4-delete-array-index-by-position Passed
Deletes the middle element of [10,20,30,40] with jshon -d 1 and verifies the resulting array has length 3, that index 1 now holds the value previously at index 2, and that the deleted value 20 no longer appears at any surviving index.
jshon -k on empty object yields no lines Original / libjansson / usage-jshon-r4-empty-object-keys-no-output Passed
Runs jshon -k against {} and verifies the output has zero lines, distinguishing the empty-keys case from the empty-string-line case.
jshon -t on fractional literal reports number Original / libjansson / usage-jshon-r4-float-pi-type-number Passed
Wraps a fractional literal in an array (jshon rejects bare scalar roots), extracts it, and verifies jshon reports the type as number and -u round-trips the exact value unchanged. Uses 0.25, which is exactly representable in IEEE 754 binary64 so jshon's printf does not widen it to a long decimal expansion.
jshon -t on integer 0 reports number Original / libjansson / usage-jshon-r4-integer-zero-type-number Passed
Wraps integer 0 in a single-element array, descends with -e 0 -t, and verifies jshon classifies 0 as number while -u emits the literal 0.
jshon -k lists keys regardless of value type Original / libjansson / usage-jshon-r4-mixed-value-types-keys-only Passed
Lists keys of an object whose values span all JSON scalar and container types and verifies jshon -k emits only the key names exactly once each, with no value bytes leaking into the listing.
jshon manipulated output round-trips through disk Original / libjansson / usage-jshon-r4-output-to-disk-roundtrip Passed
Deletes a key with jshon and redirects the resulting JSON to a file, then reopens the file with jshon -F to verify the deletion survived the disk round-trip and that surviving keys still resolve to their original values.
jshon -e walks six levels of nesting Original / libjansson / usage-jshon-r4-six-level-nested-extract Passed
Builds a six-level deep object l1.l2.l3.l4.l5.l6 == "deepest" and verifies jshon -t reports object at every intermediate level, string at the leaf, and -u returns the leaf string verbatim.
jshon tolerates leading and trailing whitespace on stdin Original / libjansson / usage-jshon-r4-stdin-leading-trailing-whitespace Passed
Pipes a JSON object surrounded by leading newlines/spaces and trailing whitespace into jshon, and verifies the parser still extracts the nested value identically to the whitespace-stripped version.
jshon -l on unicode string reports UTF-8 byte length Original / libjansson / usage-jshon-r4-unicode-string-codepoint-length Passed
Stores a three-codepoint string containing an escaped e-acute ("a\\u00e9z", whose UTF-8 encoding is 4 bytes), verifies jshon -l reports 4 (jshon's documented "length" for strings is the strlen of the UTF-8 representation, not a codepoint count), and that -u emits exactly the 4 UTF-8 bytes followed by a newline.
jshon -t on each json type within a deeply nested array Original / libjansson / usage-jshon-r5-deep-mixed-types-per-index Passed
Walks into a deeply nested mixed-type array and queries jshon -t at each index, verifying that string, number, bool, null, array, and object are all reported correctly within the same document.
jshon -l on empty string value Original / libjansson / usage-jshon-r5-empty-string-length Passed
Extracts an empty string field and queries jshon -l on it, verifying that the reported byte length is exactly 0.
jshon -e on path with hyphenated keys Original / libjansson / usage-jshon-r5-extract-hyphenated-path Passed
Walks a nested object whose keys contain hyphens at multiple levels and verifies that jshon -e accepts the hyphenated key tokens and returns the leaf string intact.
jshon -e on object with numeric-looking string keys Original / libjansson / usage-jshon-r5-extract-numeric-string-keys Passed
Confirms that jshon -e treats numeric-looking object keys "0" and "1" as ordinary string keys (object lookup) rather than as array indices, and that the associated values resolve correctly.
jshon insert negative integer at array front Original / libjansson / usage-jshon-r5-insert-negative-integer Passed
Builds a fresh negative integer with jshon -n -1 and inserts it at index 0 of an existing array, verifying length grows by one, the new front element reads back as -1, and the previous head shifts to index 1.
jshon -k preserves object insertion order Original / libjansson / usage-jshon-r5-keys-insertion-order Passed
Constructs an object with a deliberately non-alphabetical insertion order and verifies that jshon -k emits the keys in that exact source order, line by line.
jshon multiple -d in sequence Original / libjansson / usage-jshon-r5-multiple-d-sequence Passed
Chains three -d deletes against the root object in a single jshon invocation and verifies that all three keys are removed while the surviving keys remain reachable.
jshon piped twice via stdout chain Original / libjansson / usage-jshon-r5-piped-twice-stdout-chain Passed
Pipes the output of one jshon invocation (extracting a sub-document) into a second jshon invocation, verifying that an emitted JSON sub-document is itself a valid input to jshon and that downstream extraction returns the expected leaf.
jshon output redirected to file then re-parsed Original / libjansson / usage-jshon-r5-redirect-to-file-and-reparse Passed
Captures jshon's emitted JSON sub-document via shell redirection into a file, then re-loads that file with jshon -F and verifies the round-tripped document still answers structural queries (type, length, key extract) consistently.
jshon -e on string containing JSON-like brackets Original / libjansson / usage-jshon-r5-string-with-bracket-content Passed
Reads a string value whose contents look like a JSON array literal ("[hello]") and verifies that jshon -e -u returns the raw bracketed string verbatim instead of attempting to parse it as a sub-document.
jshon chained -d a -d b -d c against root object Original / libjansson / usage-jshon-r6-chained-three-deletes Passed
Issues three consecutive -d deletes (a, b, c) in a single jshon invocation against a six-key object, then re-emits the surviving JSON and verifies that the three named keys are gone, the remaining three keys are intact, and -l reports length 3.
jshon -k on an array fails with parse error Original / libjansson / usage-jshon-r6-empty-array-keys-no-output Passed
Anchors the type and length of an empty array via jshon -t and -l, then confirms that jshon -k on an array (which has no keys, only indices) fails with non-zero exit and emits a parse-error diagnostic to stderr - the documented behavior that callers must distinguish keys-bearing objects from arrays before requesting -k.
jshon -e on first vs last element of an array Original / libjansson / usage-jshon-r6-first-vs-last-array-element Passed
Picks the same array's first element via -e 0 and its last element via -e <length-1>, asserting that the two extracted values are distinct, the lengths reported by -l match, and that types at both ends match expectations. Documents that positive-indexing both ends works (jshon does not support negative array indices).
jshon insert null at array index 1 Original / libjansson / usage-jshon-r6-insert-null-at-index Passed
Pushes a fresh null with jshon -n null and inserts it at index 1 of a four-element integer array, verifying that the inserted slot reports type null, the array length grows to five, and the previous index-1 element shifts right to index 2.
jshon insert true at array index 2 Original / libjansson / usage-jshon-r6-insert-true-at-index Passed
Pushes a fresh boolean true with jshon -n true and inserts it at index 2 of a four-element string array, verifying that -t at index 2 reports bool, the array length grows to five, and the previous index-2 string shifts right to index 3.
jshon -l counts a 500-element array Original / libjansson / usage-jshon-r6-large-array-500-length Passed
Builds a JSON array of 500 sequential integers (0..499), writes it to a file, and verifies jshon -F reports length 500, type array, and that boundary indices 0, 250, and 499 each unstring to their numeric value. Stress test extending the round-3 200-element baseline.
jshon -e on object with numeric-string and word-string keys Original / libjansson / usage-jshon-r6-mixed-integer-string-keys Passed
Constructs an object whose keys mix purely numeric strings ("1", "2", "10") with alphabetic words ("first", "second"), then verifies jshon -e treats every key as a string (since JSON object keys are always strings) and returns the matching values for both flavors.
jshon round-trip emits stable canonical formatting Original / libjansson / usage-jshon-r6-roundtrip-formatting-stable Passed
Feeds the same JSON document through jshon twice using two different input whitespace shapes (compact and pretty-printed with newlines and tabs) and verifies that the two normalized outputs are byte-for-byte identical. jshon's emit format does not preserve original whitespace, but it must be deterministic across whitespace variants of the same logical document.
jshon -u decodes string values containing escaped tabs and newlines Original / libjansson / usage-jshon-r6-tab-newline-string-values Passed
Reads two object fields whose JSON-encoded string values contain escape sequences \t (tab) and \n (newline), then verifies that jshon -u emits the decoded literal control character so the byte length and surrounding text match expectations.
jshon -t after -d at a deeply nested location Original / libjansson / usage-jshon-r6-type-after-deep-delete Passed
Walks four levels deep into a nested object, deletes one key from the innermost object, then asks for -t at the parent, verifying the parent is still an object, its length dropped from 3 to 2, and the deleted key no longer resolves while siblings still do.
jshon -a iterates element types across an array Original / libjansson / usage-jshon-r7-across-array-types Passed
Applies jshon -a -t against a heterogeneous five-element root array and verifies that the across operator emits exactly five lines of type labels in array order, matching number, string, bool, null, and object respectively.
jshon -a -e id -u plucks one field from each record Original / libjansson / usage-jshon-r7-across-extract-field Passed
Applies the across operator to an array of three uniform record objects, extracts the id field from each, unstrings it, and verifies the three id strings emerge in input order on three separate lines.
jshon -a -u unstrings every array element Original / libjansson / usage-jshon-r7-across-unstring-strings Passed
Streams a homogeneous string array through jshon -a -u and verifies the output contains exactly the four raw (unquoted) strings, one per line, in the original array order, exercising the across operator combined with unstring rather than per-index extracts.
jshon builds an array from -n array via repeated -i append Original / libjansson / usage-jshon-r7-build-array-from-empty Passed
Starts with jshon -n array and appends three numeric elements using -n <num> -i append, then verifies the resulting array has length three with values 7, 8, 9 at positions 0, 1, 2 respectively.
jshon builds an object incrementally with -s and -i key Original / libjansson / usage-jshon-r7-build-object-with-s-i Passed
Starts from an empty object via jshon -n object, pushes string scalars with -s and inserts each at a named key with -i, building a three-key object whose key list, length, and per-key unstring values are all confirmed against the assembled document.
jshon delete a key and re-insert with new value Original / libjansson / usage-jshon-r7-delete-then-reinsert-key Passed
Deletes an existing object key with -d, pushes a new string with -s, re-inserts it under the same key name with -i, and verifies the final object still has the original three keys but the targeted key now carries the replacement value.
jshon insert into a nested array via -e then -i append Original / libjansson / usage-jshon-r7-insert-into-nested-array Passed
Descends into the nested array under key items with -e, pushes a new number with -n 99, appends it with -i append, and verifies the emitted document is the modified items array of length four whose tail element is 99 while head element is preserved.
jshon -k line count matches -l for a 50-key object Original / libjansson / usage-jshon-r7-keys-count-via-wc Passed
Generates a 50-entry JSON object on the fly via shell, lists its keys with jshon -k piped to wc -l, asks jshon -l for the length on the same input, and verifies the two independent counts agree at exactly 50.
jshon -e values -e 1 -p -l reports parent array length Original / libjansson / usage-jshon-r7-nested-array-pop-length Passed
Descends into a nested integer array element, pops with -p, and asks for the array length, verifying the navigator reports the size of the array (5) rather than the previously selected scalar at index 1.
jshon -t reports the canonical label for every JSON shape via -F Original / libjansson / usage-jshon-r7-type-survey-across-shapes Passed
Wraps each scalar/container shape inside a one-element array document, then descends with jshon -F file -e 0 -t and asserts the type label printed for object, array, string, integer number, fractional number, true bool, false bool, and null all match the expected jshon vocabulary.
jshon -V makes intermediate edits non-propagating without explicit re-insertion Original / libjansson / usage-jshon-r8-by-value-edit-history Passed
Demonstrates the documented by-reference vs by-value distinction: without -V the chain -e c -n 7 -i d -p mutates the inner object so c.d becomes 7, while with -V the same chain leaves c.d unchanged at the original 5 because the popped intermediate is not re-inserted, and explicitly re-inserting with -i c under -V finally propagates the change.
jshon -C makes missing-key extraction recover with a null on the stack Original / libjansson / usage-jshon-r8-continue-missing-key-yields-null Passed
Without -C, jshon -e on an absent object key aborts with a non-zero exit; with -C, the same extraction pushes a null onto the edit stack so a following -t reports the literal type label null and the invocation succeeds, demonstrating the documented continue-on-error semantics.
jshon walks seven nested object levels and unwinds with chained -p Original / libjansson / usage-jshon-r8-deep-seven-level-walk Passed
Drills through seven nested object levels with successive -e calls to fetch the leaf string at l1.l2.l3.l4.l5.l6.l7, then re-runs the descent and pops back four times with chained -p to confirm the navigator lands on level l3 whose only key is l4, exercising deep navigation and stack-unwind balance.
jshon -a maps over an empty top-level array as a silent no-op Original / libjansson / usage-jshon-r8-empty-array-across-noop Passed
Applies the across operator to a top-level empty array and a nested empty array under a key, verifying the inner action -t produces no output lines and exits zero in both cases, while -k against the empty array still fails as documented because keys is undefined for arrays of any size.
jshon -n null -i key inserts the literal null into an object Original / libjansson / usage-jshon-r8-insert-null-at-key Passed
Starts from an empty object via jshon -n object, pushes a null with -n null, inserts it at key marker, and verifies the resulting document has length one, lists key marker on a -k pass, reports type null at that key on a -t pass, and that the long-form value null is identical to its abbreviation -n n.
jshon -0 emits NUL-delimited unstring output instead of newline-delimited Original / libjansson / usage-jshon-r8-null-delimiter-unstring Passed
Maps -u across an array of strings with and without -0 and inspects the raw byte stream, asserting that without -0 jshon separates entries with 0x0a newlines while with -0 the same payload is separated with 0x00 null bytes, and that xargs -0 can recover the values intact when piped through the null-delimited form.
jshon -e treats a numeric-looking object key as a string and an array index as integer Original / libjansson / usage-jshon-r8-numeric-string-key-vs-array-index Passed
Constructs an object whose keys are the digit strings 123 and 456 plus an array of three numbers, and verifies that jshon -e 123 against the object returns the value bound to the string key while jshon -e 1 against the array returns the second element by integer index, demonstrating that the same -e argument is interpreted by container type rather than by the literal characters supplied.
jshon -Q silences error reporting while preserving the failing exit Original / libjansson / usage-jshon-r8-quiet-suppresses-stderr Passed
Compares jshon -e on a missing key with and without -Q, asserting that the bare invocation writes a non-empty error to stderr while the -Q variant emits nothing on stderr, and that both invocations still exit non-zero so callers can detect the failure without parsing diagnostics.
jshon -F /dev/stdin reads document delivered through a here-document Original / libjansson / usage-jshon-r8-stdin-via-heredoc Passed
Feeds a small object document through a quoted bash here-document into jshon -F /dev/stdin and confirms the parser accepts the synthetic stdin path, returning the expected top-level type, the deep-nested null type label, and the unstring of a string field, exercising the file-mode reader against a non-regular input.
jshon round-trips a 4000-character string value through unstring Original / libjansson / usage-jshon-r8-very-long-string-roundtrip Passed
Builds a JSON object whose value is a single ASCII string of 4000 X characters, parses it through jshon, extracts the value with -e -u, and verifies the unstring output is exactly 4000 bytes plus the trailing newline so libjansson preserves long string payloads without truncation, splitting, or escape expansion.
jshon -e then -l reports nested array length Original / libjansson / usage-jshon-r9-array-extract-then-length Passed
Extracts a nested array via -e and pipes through -l to verify the inner length matches the inserted element count.
jshon array of objects aggregate -a -e Original / libjansson / usage-jshon-r9-array-of-objects-aggregate Passed
Iterates an array of objects with -a -e to extract one field per object and verifies each extracted value appears in the output.
jshon -a on empty array produces no output Original / libjansson / usage-jshon-r9-empty-array-aggregate-noop Passed
jshon -k preserves input key order Original / libjansson / usage-jshon-r9-keys-sorted-by-input Passed
Builds an object whose keys are inserted in non-alphabetical order and verifies jshon -k emits them in input insertion order.
jshon preserves large positive integer Original / libjansson / usage-jshon-r9-large-integer-roundtrip Passed
Reads a JSON document containing a 10-digit positive integer and verifies jshon -u emits the same integer literal.
jshon nested object key extract Original / libjansson / usage-jshon-r9-nested-object-key-extract Passed
Extracts a string value from a three-level nested object using chained -e and -u and verifies the leaf string is rendered verbatim.
jshon -p reads after pop Original / libjansson / usage-jshon-r9-pop-array-back Passed
Pops the last element from an array with -p and verifies the resulting array length matches the expected reduced count.
jshon -t reports string type Original / libjansson / usage-jshon-r9-stat-string-type Passed
jshon -u preserves embedded double quote Original / libjansson / usage-jshon-r9-string-with-quote-escaped Passed
Extracts a string field whose value contains an escaped double quote and verifies the rendered output keeps the literal quote character.
jshon -u preserves embedded tab in string Original / libjansson / usage-jshon-r9-string-with-tab-unstring Passed
Extracts a string field containing an embedded tab via -u and verifies the rendered output contains an actual tab character.
jshon reads a string field Original / libjansson / usage-jshon-read-field Passed
jshon records length Original / libjansson / usage-jshon-records-length Passed
jshon reports root array length Original / libjansson / usage-jshon-root-array-length Passed
jshon reports root array type Original / libjansson / usage-jshon-root-array-type Passed
jshon rejects root bool document Original / libjansson / usage-jshon-root-bool-type Passed
Runs jshon against a root boolean document and verifies the client rejects primitive-root JSON input.
jshon root key list Original / libjansson / usage-jshon-root-key-list Passed
jshon rejects root null document Original / libjansson / usage-jshon-root-null-type Passed
Runs jshon against a root null document and verifies the client rejects primitive-root JSON input.
jshon root number type Original / libjansson / usage-jshon-root-number-type Passed
jshon root object type Original / libjansson / usage-jshon-root-object-type Passed
jshon rejects root string document Original / libjansson / usage-jshon-root-string-type Passed
Runs jshon against a root JSON string and verifies the client rejects primitive-root JSON input.
jshon scalar type survey Original / libjansson / usage-jshon-scalar-type-survey Passed
jshon scientific number field Original / libjansson / usage-jshon-scientific-number-field Passed
jshon set top-level container types Original / libjansson / usage-jshon-set-container-types Passed
Loads a JSON object and a JSON array as the top-level value through jshon -n and confirms the type and length each match the loaded document.
jshon set top-level scalar types Original / libjansson / usage-jshon-set-scalar-types Passed
Uses jshon -n to load each JSON scalar shape (string, number, true, false, null) as the document and verifies the type label reported by -t.
jshon -S sorts object keys in output Original / libjansson / usage-jshon-sort-keys-output Passed
Re-emits a JSON object through jshon -S and verifies the listed keys are produced in lexicographic order regardless of the input ordering.
jshon string with spaces Original / libjansson / usage-jshon-string-with-space Passed
jshon string with spaces field Original / libjansson / usage-jshon-string-with-spaces-field Passed
Reads a JSON string field containing whitespace with jshon and verifies the emitted phrase preserves the embedded space.
jshon third array value Original / libjansson / usage-jshon-third-array-value Passed
jshon true field Original / libjansson / usage-jshon-true-field Passed
jshon reports value type Original / libjansson / usage-jshon-type-check Passed
jshon decodes escaped e-acute Original / libjansson / usage-jshon-unicode-eacute-decode Passed
Reads an escaped é inside a JSON string and verifies jshon -u emits the UTF-8 e-acute byte sequence.
jshon Unicode escape string Original / libjansson / usage-jshon-unicode-escape-string Passed
jshon unicode string Original / libjansson / usage-jshon-unicode-string Passed
Extracts a JSON string containing escaped Unicode through jshon and verifies the decoded text is emitted.
jshon zero number value Original / libjansson / usage-jshon-zero-number-value Passed
CVE-2013-6401 libjansson regression Original / libjansson / cve-2013-6401 Passed
Asserts that inserting 20000 distinct keys into a json_object completes in linear time (well under 2s), confirming the hash seed is randomized rather than the pre-2.6 deterministic lookup3 seed that allowed hash-collision CPU DoS.
CVE-2016-4425 libjansson regression Original / libjansson / cve-2016-4425 Passed
Asserts that json_loads enforces JSON_PARSER_MAX_DEPTH for deeply nested arrays, returning a parse error rather than blowing the stack via uncontrolled recursion.
Jansson array iteration sum Port / libjansson / array-iteration-sum Passed
Jansson malformed JSON error Port / libjansson / malformed-json-error Passed
Jansson object dump round trip Port / libjansson / object-dump-roundtrip Passed
Jansson pack and unpack values Port / libjansson / pack-unpack-values Passed
Jansson refcount object update Port / libjansson / refcount-object-update Passed
jshon walks a 2D array Port / libjansson / usage-jshon-2d-array-walk Passed
jshon array first string type Port / libjansson / usage-jshon-array-first-string-type-name Passed
Parses a JSON array with jshon, selects the first string element, and verifies the reported element type is string.
jshon array index Port / libjansson / usage-jshon-array-index Passed
jshon array last element Port / libjansson / usage-jshon-array-last-element Passed
jshon array root length Port / libjansson / usage-jshon-array-length-root Passed
jshon reports array length Port / libjansson / usage-jshon-array-length Passed
jshon array object second key Port / libjansson / usage-jshon-array-object-second-key Passed
jshon root array type Port / libjansson / usage-jshon-array-root-type Passed
jshon array second value Port / libjansson / usage-jshon-array-second-value Passed
jshon array root type Port / libjansson / usage-jshon-array-type-root Passed
jshon prints array values Port / libjansson / usage-jshon-array-values Passed
jshon array object second name Port / libjansson / usage-jshon-batch11-array-object-second-name Passed
jshon file nested number Port / libjansson / usage-jshon-batch11-file-nested-number Passed
jshon hyphen key field Port / libjansson / usage-jshon-batch11-hyphen-key-field Passed
jshon matrix row length Port / libjansson / usage-jshon-batch11-matrix-row-length Passed
jshon matrix value Port / libjansson / usage-jshon-batch11-matrix-value Passed
jshon negative number Port / libjansson / usage-jshon-batch11-negative-number Passed
jshon nested bool unstring Port / libjansson / usage-jshon-batch11-nested-bool-unstring Passed
jshon nested null type Port / libjansson / usage-jshon-batch11-nested-null-type Passed
jshon root array object field Port / libjansson / usage-jshon-batch11-root-array-object-field Passed
jshon slash string Port / libjansson / usage-jshon-batch11-slash-string Passed
jshon enumerates a 100-key object Port / libjansson / usage-jshon-big-object-100-keys Passed
Builds a JSON object with exactly 100 keys, then verifies jshon -l reports 100 and jshon -k emits 100 distinct key lines that match the constructed names.
jshon bool false type Port / libjansson / usage-jshon-bool-false-type Passed
Reads a false boolean field with jshon and verifies that the selected value reports the boolean type.
jshon bool true type Port / libjansson / usage-jshon-bool-true-type Passed
Reads a true boolean field with jshon and verifies that the selected value reports the boolean type.
jshon boolean array values Port / libjansson / usage-jshon-boolean-array-values Passed
jshon number field Port / libjansson / usage-jshon-count-field Passed
jshon deep array length Port / libjansson / usage-jshon-deep-array-length Passed
jshon deep extract then unstring Port / libjansson / usage-jshon-deep-extract-unstring Passed
Drills three levels into nested objects and arrays then prints the leaf value with -u stripped of quotes.
jshon deep extract with mixed object keys and array indices Port / libjansson / usage-jshon-deep-mixed-key-index Passed
Walks a four-level nested document by alternating object key extracts and array index extracts and verifies the leaf string value is reached intact.
jshon deep object keys Port / libjansson / usage-jshon-deep-object-keys Passed
jshon delete key roundtrip Port / libjansson / usage-jshon-delete-key-roundtrip Passed
Removes an object member with -d and confirms that key is absent from the keys listing while siblings remain.
jshon edit then extract chain Port / libjansson / usage-jshon-edit-extract-chain Passed
Deletes a key from a root object with -d, then extracts a sibling and unstrings its value within the same jshon invocation, asserting the chain produces the expected leaf and that the deleted key is absent from a follow-up keys listing.
jshon empty array length Port / libjansson / usage-jshon-empty-array-length Passed
jshon empty object length Port / libjansson / usage-jshon-empty-object-length Passed
jshon empty string field Port / libjansson / usage-jshon-empty-string-field Passed
jshon escaped newline string Port / libjansson / usage-jshon-escaped-newline-string Passed
Decodes an escaped newline string with jshon and verifies both decoded text lines are present in the output.
jshon escaped slash string Port / libjansson / usage-jshon-escaped-slash-string Passed
jshon escaped string Port / libjansson / usage-jshon-escaped-string Passed
Extracts a JSON string containing escape sequences with jshon and verifies the unescaped text is emitted.
jshon false field Port / libjansson / usage-jshon-false-field Passed
jshon file array length Port / libjansson / usage-jshon-file-array-length Passed
jshon file array object key Port / libjansson / usage-jshon-file-array-object-key Passed
jshon file array sum Port / libjansson / usage-jshon-file-array-sum Passed
jshon file empty object Port / libjansson / usage-jshon-file-empty-object Passed
jshon reads file input Port / libjansson / usage-jshon-file-input Passed
jshon file nested array length Port / libjansson / usage-jshon-file-nested-array-length Passed
jshon file nested label Port / libjansson / usage-jshon-file-nested-label Passed
jshon file nested object key Port / libjansson / usage-jshon-file-nested-object-key Passed
Reads a deeply nested object value from a JSON file with jshon and verifies the selected label string.
jshon file object keys Port / libjansson / usage-jshon-file-object-keys Passed
Reads a JSON object from a file with jshon and verifies the emitted key list contains both object keys.
jshon file root array Port / libjansson / usage-jshon-file-root-array Passed
jshon file root object Port / libjansson / usage-jshon-file-root-object Passed
jshon file root string value Port / libjansson / usage-jshon-file-root-string-value Passed
jshon file unicode label Port / libjansson / usage-jshon-file-unicode-label Passed
jshon file input matches stdin input Port / libjansson / usage-jshon-file-vs-stdin-equivalence Passed
jshon first record name Port / libjansson / usage-jshon-first-record-name Passed
jshon float field Port / libjansson / usage-jshon-float-field Passed
jshon fractional number value Port / libjansson / usage-jshon-fractional-number-value Passed
jshon insert at array back Port / libjansson / usage-jshon-insert-array-back Passed
Appends a new value to the end of a three-element array by inserting at the post-last index and verifies the inserted value lands at the new tail.
jshon insert at array front Port / libjansson / usage-jshon-insert-array-front Passed
Inserts a new value at index 0 of a three-element array using jshon -n value -i 0 and verifies the inserted value lands at index 0 while existing elements shift right.
jshon insert into array middle Port / libjansson / usage-jshon-insert-array-middle Passed
Inserts a new value at index 2 of a four-element array using jshon -n value -i 2 and verifies the inserted value lands at index 2 with elements after it shifted right.
jshon keys listing across object members Port / libjansson / usage-jshon-keys-listing-multiple Passed
jshon preserves a large integer Port / libjansson / usage-jshon-large-integer-preserved Passed
Reads a 15-digit integer member and verifies the digits round-trip through jshon -u without truncation.
jshon length on array object and string Port / libjansson / usage-jshon-length-three-shapes Passed
jshon nonexistent key exit status Port / libjansson / usage-jshon-missing-key-error-exit Passed
Confirms jshon -e on an absent object key exits with a nonzero status while a present key returns success.
jshon name field Port / libjansson / usage-jshon-name-field Passed
jshon negative number field Port / libjansson / usage-jshon-negative-number-field Passed
jshon negative number value Port / libjansson / usage-jshon-negative-number-value Passed
jshon nested array third value Port / libjansson / usage-jshon-nested-array-third-value Passed
Reads the third value from a nested JSON array with jshon and verifies the extracted numeric payload.
jshon nested array value Port / libjansson / usage-jshon-nested-array-value Passed
jshon nested empty array length Port / libjansson / usage-jshon-nested-empty-array-length Passed
jshon nested key list Port / libjansson / usage-jshon-nested-key-list Passed
jshon nested object field Port / libjansson / usage-jshon-nested-object-field Passed
jshon nested object key list Port / libjansson / usage-jshon-nested-object-key-list Passed
jshon nested object length Port / libjansson / usage-jshon-nested-object-length Passed
jshon nested object type Port / libjansson / usage-jshon-nested-type Passed
jshon extracts nested value Port / libjansson / usage-jshon-nested-value Passed
jshon null type Port / libjansson / usage-jshon-null-root-field-type Passed
jshon null type Port / libjansson / usage-jshon-null-type Passed
jshon number array values Port / libjansson / usage-jshon-number-array-sum Passed
jshon extracts number field Port / libjansson / usage-jshon-number-field Passed
jshon object array second type Port / libjansson / usage-jshon-object-array-second-type Passed
jshon object array third id Port / libjansson / usage-jshon-object-array-third-id Passed
Reads a field from the third object in an array with jshon and verifies the selected identifier.
jshon lists object keys Port / libjansson / usage-jshon-object-keys Passed
jshon object root length Port / libjansson / usage-jshon-object-length-root Passed
jshon object key count Port / libjansson / usage-jshon-object-length Passed
jshon object root type Port / libjansson / usage-jshon-object-type-root Passed
jshon pop returns to parent context Port / libjansson / usage-jshon-pop-parent-navigation Passed
Descends into a nested object with -e then uses -p to pop back and lists parent keys, verifying the keys belong to the outer object rather than the inner one.
chained jshon -d removes two keys and leaves the third intact Port / libjansson / usage-jshon-r10-delete-multiple-keys-leaves-remainder Passed
Applies two consecutive -d operations to a three-key object and verifies the resulting object contains exactly the remaining key with its original value preserved.
jshon -l on an empty object returns 0 Port / libjansson / usage-jshon-r10-empty-object-length-is-zero Passed
Reads {} and confirms that jshon -l reports the object length as exactly 0, distinct from the empty-array length case.
jshon -e accepts the empty string as an object key Port / libjansson / usage-jshon-r10-empty-string-key-extracted Passed
Reads an object whose sole key is the empty string, extracts the value with jshon -e "" -u, and verifies the value is recovered intact.
jshon -n null -i adds a null-valued key to an existing object Port / libjansson / usage-jshon-r10-insert-null-into-existing-object Passed
Inserts a JSON null using -n null -i into an object that already has one key and verifies the resulting object has both keys, with the new one typed as null.
jshon -n 42 -i adds a numeric key to an existing object Port / libjansson / usage-jshon-r10-insert-numeric-via-n-into-object Passed
Inserts the literal integer 42 with -n 42 -i count into an existing one-key object and verifies the new key is typed as number, the original key remains, and the unstrung value parses back to 42.
jshon -s value -i key adds a string entry to an empty object Port / libjansson / usage-jshon-r10-insert-string-builds-object-key Passed
Starts from an empty object, chains -s with -i to insert a string-valued key, and confirms the result is an object containing exactly that key with the expected unstrung value.
jshon -a -t emits one type per array element Port / libjansson / usage-jshon-r10-iter-array-types-each-line Passed
Iterates a heterogeneous array via jshon -a and applies -t to each element, verifying every element-level type appears on its own output line.
jshon -t reports number for scientific-notation literal Port / libjansson / usage-jshon-r10-number-exponent-type-is-number Passed
Parses a JSON value written with exponent notation (1e3) and confirms jshon -t reports the type as "number" rather than rejecting the literal or coercing to string.
jshon -p applied twice ascends to the grandparent Port / libjansson / usage-jshon-r10-pop-twice-yields-grandparent-keys Passed
Descends two levels into a nested object then issues two consecutive -p operations and lists keys, verifying the result lists the grandparent (root) keys rather than either intermediate scope.
jshon -s preserves an embedded double quote across roundtrip Port / libjansson / usage-jshon-r10-string-with-quote-via-s-roundtrip Passed
Inserts a string containing an embedded double quote via jshon -s into an object key, then extracts the value with -u and verifies the original byte sequence (including the quote) is recovered without escape leakage.
jshon -e -1 extracts the last element of an array Port / libjansson / usage-jshon-r11-array-extract-negative-one-last Passed
Reads an array of numeric literals and asserts that jshon -e -1 -u returns the final element, exercising the documented wrap-around behavior of negative array indexes for extract.
jshon -i append adds a value to the end of an array Port / libjansson / usage-jshon-r11-array-insert-append-keyword Passed
Starts from a 3-element array, pushes a string via -s, and inserts it with -i append; verifies the resulting array has length 4 and the new value lives at index 3.
jshon -n t inserts a JSON true value Port / libjansson / usage-jshon-r11-bool-abbreviation-t-yields-true Passed
Uses the documented one-character abbreviation -n t (and -n f) to insert booleans into an object; verifies both keys round-trip with the bool type and the unstring values true/false.
jshon -n '[]' creates an empty array literal Port / libjansson / usage-jshon-r11-bracket-syntax-creates-empty-array Passed
Asserts that jshon -n '[]' produces the empty-array sigil and that inserting it into an object yields a key whose value parses as an array of length 0.
jshon -F file -I -d key rewrites the file in place Port / libjansson / usage-jshon-r11-in-place-delete-key-rewrites-file Passed
Writes a two-key object to a file, runs jshon -F path -I -d key to delete one key in place, and verifies the file now parses to an object containing only the surviving key.
jshon -n object -i key creates an empty nested object Port / libjansson / usage-jshon-r11-insert-empty-object-creates-nested Passed
Starting from {}, uses -n object -i nested to add a key whose value is the empty object; verifies the parent has length 1 and the nested value parses as an object of length 0.
jshon -P strips jsonp callback wrapper before parsing Port / libjansson / usage-jshon-r11-jsonp-strip-extracts-payload Passed
Wraps a JSON object in a jsonp callback and verifies jshon -P unwraps it so the inner payload can be extracted via subsequent actions.
jshon -a -a -u maps unstring across leaves of a 2D array Port / libjansson / usage-jshon-r11-nested-across-twice-yields-leaves Passed
Iterates a 2x2 numeric matrix with two -a actions and -u, verifying the result is one leaf value per line in row-major order, exercising nested -a behavior.
jshon -S sorts keys recursively in nested objects Port / libjansson / usage-jshon-r11-sort-recurses-into-nested-objects Passed
Feeds a two-level object whose top-level and inner keys are both scrambled, and verifies jshon -S returns both layers with keys in lexicographic order.
jshon --version emits an 8-digit YYYYMMDD release date Port / libjansson / usage-jshon-r11-version-flag-yyyymmdd Passed
Invokes jshon --version and verifies stdout is a single 8-digit YYYYMMDD timestamp with stderr empty and exit zero, exercising the documented version banner format.
jshon -d 0 removes the first array element and shifts the rest Port / libjansson / usage-jshon-r12-delete-array-first-element Passed
Pipes a 4-element string array through jshon -d 0 and verifies the result has length 3 with the original second element now at index 0.
jshon -e key -u prints empty string for a JSON empty-string value Port / libjansson / usage-jshon-r12-empty-string-value-unstring Passed
Reads an object with a key whose value is the empty string and verifies jshon -e key -u outputs zero bytes while -e key -t reports the type as string.
jshon -e extracts a value via a key containing spaces Port / libjansson / usage-jshon-r12-extract-key-with-spaces Passed
Reads an object whose key is a multi-word string with spaces and verifies jshon -e "first name" -u returns the underlying value, exercising whitespace handling in extract paths.
jshon -i 0 inserts a string at the front of an array Port / libjansson / usage-jshon-r12-insert-into-array-at-zero Passed
Pipes a string through -s and inserts it into an array at position 0 with -i 0; verifies the resulting array starts with the inserted element and the original elements shift right.
jshon -k after -s value -i adds the new key to the listing Port / libjansson / usage-jshon-r12-keys-after-insert-includes-new Passed
Inserts a string value into an object via -s value -i newkey and verifies jshon -k afterwards lists the new key alongside the original keys.
jshon -l reports 1000 for a 1000-element integer array Port / libjansson / usage-jshon-r12-large-array-1000-length Passed
Generates a JSON array of 1000 integers, pipes it into jshon -l and verifies the reported length is exactly 1000, exercising the parser at moderate scale.
jshon -e a -e 1 -t reports object for nested array element Port / libjansson / usage-jshon-r12-nested-array-extract-then-type Passed
Reads an object with key "a" whose value is an array of mixed scalars and an object, and verifies jshon -e a -e 1 -t prints "object" for the second element.
jshon round-trips a simple integer array unchanged through stdin Port / libjansson / usage-jshon-r12-roundtrip-stable-output-array Passed
Feeds a canonical [1,2,3] integer array through jshon with no actions and verifies the output is equivalent JSON whose -l length is 3 and whose first element is 1.
jshon -u decodes JSON escaped backslash to single backslash Port / libjansson / usage-jshon-r12-string-with-backslash-roundtrip Passed
Reads a string value containing a JSON-escaped backslash and verifies jshon -u outputs the literal single backslash character.
jshon -e 0 returns the first element of an array Port / libjansson / usage-jshon-r12-zero-as-array-index Passed
Pipes a 3-element string array through jshon -e 0 -u and verifies the unstring output is the literal first string.
jshon -d 1 reduces a 5-element array to length 4 Port / libjansson / usage-jshon-r13-delete-shrinks-array-length Passed
Pipes a 5-element integer array through jshon -d 1 and verifies the resulting -l length is exactly 4 and the original element previously at index 2 has shifted to index 1.
jshon -e nums -t reports an array nested in a pre-built JSON object Port / libjansson / usage-jshon-r13-insert-array-into-object-creates-nested-array Passed
Feeds jshon a pre-built JSON document {"nums":[1,2,3]} on stdin and verifies -e nums -t reports "array", -e nums -l reports length 3, and -e nums -e 0 -u recovers the first element. (Noble's jshon rejects both '-n [1,2,3]' as a literal stack value AND the chained '-n [] -i nums -e nums -n 1 -a -p' build sequence with "type not mappable"; deserialising a pre-built object is the documented stable surface.)
jshon -s a 1024-character string and -e -u recovers it intact Port / libjansson / usage-jshon-r13-large-string-1024-roundtrip Passed
Builds an object with a single 1024-character ASCII string value via jshon -s value -i blob, then extracts it back with -e blob -u and verifies the recovered byte sequence matches the original byte-for-byte.
jshon -a -t emits a per-element type line for a mixed-type array Port / libjansson / usage-jshon-r13-mixed-array-across-prints-types-per-line Passed
Pipes a 4-element array containing one of each scalar shape (string, number, boolean, null) through jshon -a -t and verifies stdout contains exactly the four lines "string", "number", "bool", "null" in order, exercising iteration plus type printing.
jshon -e 123 on object with numeric-string key returns the string value Port / libjansson / usage-jshon-r13-numeric-string-key-extracted-string-type Passed
Reads an object whose key is the numeric-looking string "123" and verifies jshon -e 123 -t reports the value type as string and -u prints the literal value, exercising key lookup by digit-only token in object context.
jshon -e child -p -k at a nested object lists the parent keys Port / libjansson / usage-jshon-r13-pop-after-extract-yields-parent-keys Passed
Reads a parent object with two keys (one of which is itself an object), extracts the nested child, pops back with -p, and verifies -k afterwards lists exactly the original parent keys.
jshon prepends three values via repeated -i 0 in the expected reversed order Port / libjansson / usage-jshon-r13-prepend-three-times-final-order Passed
Starts from an empty array and prepends three string values "x" then "y" then "z" via jshon -s and -i 0 chained three times, then verifies the resulting array has length 3 and the elements appear in the order ["z","y","x"].
jshon -i append three times grows an array from 0 to length 3 Port / libjansson / usage-jshon-r13-three-appends-grow-array-length Passed
Starts from the empty array and chains three -s value -i append pairs through jshon, verifying the resulting array has length 3 and the trailing element matches the most recent append.
jshon builds a 3-key object by chaining three -s/-i pairs Port / libjansson / usage-jshon-r13-three-keys-via-chained-insert Passed
Starts from an empty object and chains -s "1" -i a -s "2" -i b -s "3" -i c through jshon to build a 3-key object, then verifies -k lists exactly the keys a, b, c (sorted) and -l reports length 3.
jshon -e a -e b -e c -u walks three nested objects to a leaf string Port / libjansson / usage-jshon-r13-three-level-extract-unstring Passed
Reads a JSON object nested three levels deep with a string leaf and verifies jshon -e a -e b -e c -u prints exactly the leaf payload, exercising chained extract through three object levels.
jshon -a -e id -u prints the id field from each object in an array Port / libjansson / usage-jshon-r14-across-extract-id-from-array-of-objects Passed
Pipes an array of three objects each carrying an "id" field through jshon -a -e id -u and verifies stdout contains exactly the three id values "1", "2", "3" in order, exercising the across operator combined with extraction.
jshon -e 1 -l after array extract reports nested array length Port / libjansson / usage-jshon-r14-array-extract-then-length-of-nested Passed
Pipes an array containing a nested 4-element array as its second element through jshon -e 1 -l and verifies the reported length is exactly 4, exercising chained extract followed by length on nested array context.
jshon -a -t on a homogeneous integer array yields four "number" lines Port / libjansson / usage-jshon-r14-array-of-numbers-across-types-all-number Passed
Pipes a 4-element integer array through jshon -a -t and verifies stdout contains exactly four lines each equal to the literal "number", exercising the across-iterator paired with type printing on a homogeneous numeric array.
jshon -d on an object key removes it from the -k listing Port / libjansson / usage-jshon-r14-delete-object-key-removes-from-keys Passed
Pipes a three-key object through jshon -d middle and verifies the resulting -k listing contains exactly "first" and "last" (sorted), exercising the documented delete operator on object keys.
jshon -e arr -e 0 -p -l after extract-pop reports parent array length Port / libjansson / usage-jshon-r14-extract-array-then-pop-back-to-array Passed
Pipes an object containing a 4-element array under key "arr" through jshon -e arr -e 0 -p -l, popping back to the array context, and verifies the reported length is exactly 4, exercising pop after a nested extract.
jshon -e a -p -k after extract and pop lists the root keys Port / libjansson / usage-jshon-r14-extract-then-pop-yields-original-keys Passed
Pipes a two-key root object through jshon -e a -p -k and verifies the popped context lists exactly the original root keys "a" and "b" (sorted), exercising the documented round-trip extract-then-pop navigation.
jshon -n true -i flag adds a boolean-true value under a new key Port / libjansson / usage-jshon-r14-insert-bool-true-into-object Passed
Starts from an empty object and chains -n true -i flag through jshon to add a boolean-true value under the key "flag", then verifies the resulting -e flag -t reports "bool" and -e flag -u prints the literal "true".
jshon -k on a 3-key object lists exactly three keys Port / libjansson / usage-jshon-r14-keys-listing-deterministic-three Passed
Pipes a three-key object through jshon -k and verifies the output contains exactly three lines whose sorted contents equal "alpha", "beta", "gamma", confirming the documented key listing behaviour.
jshon parses and reprints a 3-level nested object preserving the leaf Port / libjansson / usage-jshon-r14-roundtrip-deeply-nested-three-levels Passed
Pipes a 3-level nested object through jshon (no transforms) and verifies the resulting output, when re-parsed, still extracts the same leaf value via jshon -e a -e b -e c -u, exercising idempotent reprinting through three levels.
jshon -s with a UTF-8 snowman roundtrips intact through -e -u Port / libjansson / usage-jshon-r14-string-with-unicode-snowman-roundtrip Passed
Builds an object with a single value containing the UTF-8 snowman character via jshon -s value -i icon, then extracts it back with -e icon -u and verifies the recovered byte sequence equals the original UTF-8 encoding.
jshon -a -u unstrings every element of a string array onto its own line Port / libjansson / usage-jshon-r15-across-array-of-strings-unstring-each Passed
Pipes a four-element string array through jshon -a -u and verifies stdout contains exactly the four raw values "alpha", "beta", "gamma", "delta" in order with no surrounding quotes, exercising the documented across operator combined with unstring.
jshon -a -t prints the JSON type of each element of a mixed array Port / libjansson / usage-jshon-r15-across-mixed-types-prints-types-per-line Passed
Pipes a six-element mixed-type array through jshon -a -t and verifies stdout contains the documented type names number, string, bool, null, array, object exactly in that order, one per line, exercising the across operator combined with type extraction.
jshon -n 99 -i append adds a number to the end of an existing array Port / libjansson / usage-jshon-r15-append-numeric-via-n-into-array-end Passed
Pipes a 3-element numeric array through jshon -n 99 -i append and verifies the resulting array has length four with the literal 99 at the last position, exercising the documented append insertion mode for arrays via the -i append keyword.
jshon chains three -d deletes and reports length one with the remaining key Port / libjansson / usage-jshon-r15-delete-three-keys-leaves-one Passed
Pipes a 4-key object through three chained -d deletes and verifies the resulting object reports length one and the surviving key when listed via -k, exercising the documented chained deletion behaviour.
jshon -e nested -k lists the keys of a nested object Port / libjansson / usage-jshon-r15-extract-then-keys-of-nested-object Passed
Pipes an object with a nested object under key "nested" through jshon -e nested -k and verifies stdout contains exactly the three nested keys "x", "y", "z" in source order, exercising extract followed by key enumeration.
jshon -n array -i creates a new array-typed key on an existing object Port / libjansson / usage-jshon-r15-insert-array-via-n-into-object Passed
Pre-builds a fresh empty array via -n array on the stack and chains -i items into a one-key object, then verifies the resulting object reports type "array" under the new key, has length two, and preserves the original key, exercising the documented stack-driven array insertion pattern.
jshon -n object -i creates a new empty-object-typed key on an existing object Port / libjansson / usage-jshon-r15-insert-object-via-n-into-object Passed
Pre-builds a fresh empty object via -n object on the stack and chains -i child into a one-key object, then verifies the resulting object reports type "object" under the new key with zero internal keys and length two at the root, exercising the documented stack-driven object insertion pattern.
jshon -e a -e b -e c -p -k lists parent-of-c keys after pop Port / libjansson / usage-jshon-r15-pop-after-deep-extract-yields-parent Passed
Pipes a three-level nested object through jshon -e a -e b -e c -p -k, popping back to the b-level container, and verifies the listed keys are exactly the keys of b ("c"), exercising pop after a deep extract chain.
jshon -n 0 -i 0 prepends a number at index zero of an existing array Port / libjansson / usage-jshon-r15-prepend-numeric-via-n-into-array-front Passed
Pipes a 3-element numeric array through jshon -n 0 -i 0 and verifies the resulting array has length four with the literal 0 at index zero and the original first element shifted to index one, exercising the documented index-zero insertion mode.
jshon -s "key=value" -i tag preserves an equals-sign string through extract Port / libjansson / usage-jshon-r15-string-with-equals-sign-roundtrip Passed
Pre-builds a string containing an equals sign via -s "key=value" on the stack, inserts it under "tag" into a one-key object, and verifies the unstrung value extracted via -e tag -u equals the literal "key=value", exercising the documented string roundtrip.
jshon -e 0 -u extracts the first element of a string array Port / libjansson / usage-jshon-r16-array-index-zero-extract-unstring Passed
Pipes a three-element string array through jshon -e 0 -u and asserts stdout equals "first" exactly, exercising libjansson's array-by-integer-index lookup followed by JSON-string unescape.
jshon -e a -e b -u extracts a two-level nested string value Port / libjansson / usage-jshon-r16-extract-nested-two-levels-unstring Passed
Pipes a small object {"a":{"b":"deep"}} through jshon -e a -e b -u and asserts the printed value is exactly "deep" with no surrounding quotes, exercising libjansson's nested object navigation through two -e steps followed by -u (unstring).
jshon -e then -p restores parent object and reports type "object" Port / libjansson / usage-jshon-r16-extract-then-parent-back-to-object Passed
Pipes an object {"k":"v"} into jshon -e k -p -t and asserts stdout equals "object", exercising the documented parent navigation: extract a leaf then -p pops back to the original object whose type is "object".
jshon reads JSON from stdin redirect and extracts a string value via -e -u Port / libjansson / usage-jshon-r16-file-redirect-extract-string-value Passed
Writes a small JSON object to a temporary file, redirects it to jshon -e name -u, and asserts stdout equals "r16-fixture" exactly, exercising libjansson's file-redirect parse path through the documented -e/-u extraction chain.
jshon -l reports 3 for an object with three keys Port / libjansson / usage-jshon-r16-length-of-three-key-object Passed
Pipes an object with three top-level keys through jshon -l and asserts the printed length is exactly "3", exercising libjansson's object length reflection (number of immediate keys) through the documented -l operator.
jshon -s wraps a raw text payload into a quoted JSON string literal Port / libjansson / usage-jshon-r16-string-wrap-text-into-json-string Passed
Pipes the empty input through jshon -s hello-r16 and asserts stdout is exactly the seven-character payload wrapped in JSON double quotes ("hello-r16"), exercising libjansson's string-serialiser invoked through the documented -s wrap operator.
jshon round-trips an object whose key contains a UTF-8 snowman Port / libjansson / usage-jshon-r16-utf8-key-roundtrip-preserved Passed
Pipes an object whose key is the UTF-8 snowman U+2603 through jshon (no operators) and asserts the round-tripped output contains both the snowman byte sequence and the string value, exercising libjansson's UTF-8 preservation for object keys.
jshon -e a -e b -u extracts deep string from two-level object Port / libjansson / usage-jshon-r17-chained-unstring-two-keys Passed
Pipes {"k1":{"k2":"final"}} through jshon -e k1 -e k2 -u and asserts the unwrapped stdout equals "final" exactly, exercising libjansson's chained extract-then-unstring with explicit key names k1/k2 (distinct from r16 a/b and r17 parent/child variants).
jshon -k on a two-key object emits both key names Port / libjansson / usage-jshon-r17-keys-of-two-key-object Passed
Pipes an object with exactly two keys "alpha" and "omega" through jshon -k and asserts the captured output contains both key names on separate lines (alpha and omega), exercising libjansson's object key enumeration with a small explicit-key fixture.
jshon -l on an empty array root reports length 0 Port / libjansson / usage-jshon-r17-length-of-empty-array-zero Passed
Pipes the two-character empty-array literal [] through jshon -l and asserts stdout equals "0" exactly, exercising libjansson's array length reflection for the boundary case of an empty container.
jshon -l reports 5 for a five-element integer array Port / libjansson / usage-jshon-r17-length-of-five-element-array Passed
Builds a five-element integer array via jshon -n array followed by five -n N -i append steps and asserts jshon -l reports exactly "5", exercising libjansson's array length reflection (distinct from the r16 three-key object length test) using an array root.
jshon roundtrip object via -e -u and back through jshon -t reports number Port / libjansson / usage-jshon-r17-roundtrip-object-via-stringify Passed
Extracts a numeric leaf from {"n":42} via jshon -e n -u then pipes the resulting "42" through a fresh jshon root that re-parses it as a JSON number scalar... but jshon rejects scalar roots on noble, so instead this test verifies that the extracted number unwrapped via -u equals "42" and re-running jshon -e n -t on the same object reports type "number".
jshon -e parent -e child two-level navigation yields child string Port / libjansson / usage-jshon-r17-two-level-extract-via-parent-keys Passed
Pipes an object {"parent":{"child":"leaf"}} through jshon -e parent -e child -u and asserts stdout is exactly "leaf", exercising libjansson's two-step object navigation with distinct key names from the r16 a/b test.
jshon -n array -t reports array type for a freshly constructed empty array Port / libjansson / usage-jshon-r17-type-array-root-from-jshon-n Passed
Constructs a brand-new empty array via jshon -n array, pipes it back into jshon -t, and asserts stdout equals "array" exactly, exercising libjansson's empty-array construction and type reflection through the documented -n array idiom.
jshon -t on an empty object root reports type "object" Port / libjansson / usage-jshon-r17-type-object-root Passed
Pipes the two-character empty-object literal {} through jshon -t and asserts stdout equals "object" exactly, exercising libjansson's empty-object type reflection through the documented -t operator at the root.
jshon -e key -t on a string-valued field reports type "string" Port / libjansson / usage-jshon-r17-type-of-extracted-string-value Passed
Pipes the object {"name":"validator"} through jshon -e name -t and asserts stdout equals "string" exactly, exercising libjansson's type reflection on an extracted scalar leaf (distinct from the r16 -p parent test).
jshon -e -1 -u on a four-element string array yields the last element Port / libjansson / usage-jshon-r18-array-extract-negative-one-last Passed
Pipes ["alpha","beta","gamma","delta"] through jshon -e -1 -u and asserts stdout equals "delta" exactly, exercising libjansson's negative-index-from-end semantics in jshon's -e operator with a distinct fixture from r11 negative-one coverage.
jshon -e 1 -u on an array of strings yields the second element unwrapped Port / libjansson / usage-jshon-r18-array-of-strings-second-element-unstring Passed
Pipes ["zero","one","two","three"] through jshon -e 1 -u and asserts stdout equals "one" exactly, exercising libjansson's zero-indexed array element extraction at index 1 followed by string unwrap through the -u operator.
jshon -d on a three-key object then -k reports the two surviving keys Port / libjansson / usage-jshon-r18-delete-key-shrinks-keys-list Passed
Pipes {"a":1,"b":2,"c":3} through jshon -d b followed by -k and asserts the captured output lists exactly the two surviving keys "a" and "c" (no "b"), exercising libjansson's object-key deletion followed by key enumeration on the modified object.
jshon -n number -i count inserts a JSON number and extracts it as type number Port / libjansson / usage-jshon-r18-insert-number-into-object-via-n Passed
Starts with empty object {}, inserts the JSON number 1337 under key "count" via jshon -n 1337 -i count, then runs -e count -t and asserts stdout equals "number" exactly, exercising libjansson's numeric insert-into-object path and the type round-trip distinct from -s string coverage.
jshon -s value -i key inserts a string into an object and extracts it back Port / libjansson / usage-jshon-r18-insert-string-into-object-then-extract Passed
Starts with empty object {}, inserts the string "hello" under key "greet" via jshon -s hello -i greet, then re-extracts via -e greet -u and asserts the recovered value equals "hello" exactly, exercising libjansson's string insert-into-object path through the documented -s/-i chain.
jshon -k on a three-key object emits exactly three key-name lines Port / libjansson / usage-jshon-r18-keys-of-three-key-object-line-count Passed
Pipes an object with three keys "red", "green", "blue" through jshon -k, captures the output, and asserts the line count is exactly 3 and that each key name appears once, exercising libjansson's three-element object key enumeration with explicit named keys (distinct from r17 two-key coverage).
jshon -l reports 7 for a seven-element mixed array Port / libjansson / usage-jshon-r18-length-of-seven-element-array Passed
Pipes the JSON literal [1,2,3,4,5,6,7] through jshon -l and asserts stdout equals "7" exactly, exercising libjansson's array length reflection on a longer single-line literal array than existing r17 five-element coverage.
jshon -e child -p -k after extract+pop yields the parent object keys Port / libjansson / usage-jshon-r18-pop-after-extract-yields-keys Passed
Pipes {"parent":{"child":42},"sibling":"x"} through jshon -e parent -e child -p -p -k and asserts the captured output contains exactly the two parent-level keys "parent" and "sibling", exercising libjansson's parent-walk via -p after a chained -e descent.
jshon -e key -t on an object whose value is true reports type "bool" Port / libjansson / usage-jshon-r18-type-of-extracted-bool-true Passed
Pipes {"flag":true} through jshon -e flag -t and asserts stdout equals "bool" exactly, exercising libjansson's boolean-typed value extraction and type reflection (jshon reports the JSON true literal as type bool, distinct from null/number/string).
jshon -e key -t on an object whose value is null reports type "null" Port / libjansson / usage-jshon-r18-type-of-extracted-null-value Passed
Pipes {"x":null} through jshon -e x -t and asserts stdout equals "null" exactly, exercising libjansson's null-typed value extraction and type reflection through chained -e/-t operators (distinct from -e key -u which would not apply to null).
jshon -e 0 -u on a four-element string array yields the first element Port / libjansson / usage-jshon-r19-array-extract-zero-first Passed
Pipes ["alpha","beta","gamma","delta"] through jshon -e 0 -u and asserts stdout equals "alpha" exactly, exercising libjansson's zero-based positive-index semantics in jshon's -e operator with a fixture distinct from earlier negative-index r18 coverage.
jshon -e 1 -e name -u on an array of objects yields the second object's name Port / libjansson / usage-jshon-r19-array-of-objects-second-field-extract Passed
Pipes [{"name":"alpha"},{"name":"beta"},{"name":"gamma"}] through jshon -e 1 -e name -u and asserts stdout equals "beta" exactly, exercising libjansson's chained -e descent through an array index into an object field in a single jshon invocation.
jshon -d 1 on a four-element array reduces -l to 3 Port / libjansson / usage-jshon-r19-delete-second-array-element-length Passed
Pipes ["a","b","c","d"] through jshon -d 1 followed by -l and asserts the captured length equals "3" (libjansson removes index 1 and the array becomes ["a","c","d"]), exercising libjansson's array-element deletion path through jshon's -d on a numeric index.
jshon -n true -i flag inserts a JSON boolean and extracts it as type bool Port / libjansson / usage-jshon-r19-insert-bool-true-into-object Passed
Starts with empty object {}, inserts the JSON boolean true under key "flag" via jshon -n true -i flag, then runs -e flag -t and asserts stdout equals "bool" exactly, exercising libjansson's boolean insert-into-object path through jshon's -n raw-JSON insertion.
jshon -k on a five-key object emits exactly five key-name lines Port / libjansson / usage-jshon-r19-keys-of-five-key-object-line-count Passed
Pipes an object with five keys "one"..."five" through jshon -k, captures the output, and asserts the line count is exactly 5 and that each key name appears once, exercising libjansson's five-element object key enumeration with explicit named keys (distinct from r18 three-key coverage).
jshon -l on an eleven-element integer array reports 11 Port / libjansson / usage-jshon-r19-length-of-eleven-element-array Passed
Pipes [0,1,2,3,4,5,6,7,8,9,10] through jshon -l and asserts stdout equals "11" exactly, exercising libjansson's array-length reporting at a length distinct from earlier r17/r18 fixtures and across a single-digit-to-two-digit transition.
jshon -e items -e 0 -p -p -e items -l reports the original array length Port / libjansson / usage-jshon-r19-pop-after-array-extract-yields-length Passed
Pipes {"items":[10,20,30,40,50]} through jshon -e items -e 0 -p -p -e items -l and asserts stdout equals "5" exactly, exercising libjansson's chained parent-walk (-p) after a double descent followed by re-extracting the array and asking for its length.
jshon -e flag -t on {"flag":false} returns bool Port / libjansson / usage-jshon-r19-type-of-extracted-bool-false Passed
Pipes {"flag":false} through jshon -e flag -t and asserts stdout equals "bool" exactly, exercising libjansson's type classification of the JSON false literal extracted from an object (distinct from the r18 true-value coverage).
jshon -e k -t on a fractional number returns number Port / libjansson / usage-jshon-r19-type-of-extracted-number-fractional Passed
Pipes {"k":3.14} through jshon -e k -t and asserts stdout equals "number" exactly, exercising libjansson's type classification of an extracted JSON fractional number (jshon collapses int and real JSON types into the unified "number" label).
jshon -e on a key with a Unicode escape returns the expected string value Port / libjansson / usage-jshon-r19-unicode-key-extract-value Passed
Pipes {"étoile":"star"} through jshon -e $'étoile' -u and asserts the unwrapped result equals "star" exactly, exercising libjansson's parsing of \u escapes in object keys followed by jshon's UTF-8 key lookup on the resulting in-memory object.
jshon -a -t reports the four element types of a mixed-type array Port / libjansson / usage-jshon-r20-across-types-of-mixed-array-elements Passed
Pipes [true,1,"x",null] through jshon -a -t and asserts the four output lines are exactly "bool", "number", "string", "null" in order, exercising libjansson's value-type enumeration via jshon's across-map and type-name reporting on a four-element mixed array.
jshon -s value -i append on a three-element array grows length to four Port / libjansson / usage-jshon-r20-append-string-into-three-element-array-length Passed
Starts with the array [1,2,3], creates a JSON string "tail" with -s, inserts it at index append via -i, and asserts the resulting array has length 4, exercising libjansson's array growth via jshon's append-keyword insertion path.
jshon -C -e missing -t reports the type "null" for a missing key under continue mode Port / libjansson / usage-jshon-r20-continue-flag-missing-key-yields-null-type Passed
Pipes {"a":1} through jshon -C -e nonexistent -t and asserts the printed type is "null", exercising libjansson's value model when jshon's continue flag substitutes a null sentinel for a missing object key rather than aborting.
jshon -d 3 on a four-element array reduces its length to three Port / libjansson / usage-jshon-r20-delete-highest-index-shrinks-array Passed
Pipes [10,20,30,40] through jshon -d 3 -l and asserts the resulting length is 3, exercising libjansson's array length tracking when jshon deletes the highest-indexed element by explicit numeric index distinct from earlier rounds' coverage of front-index deletion.
jshon -S -e nested -k emits the nested object keys in alphabetical order Port / libjansson / usage-jshon-r20-extract-then-sort-keys-alphabetical Passed
Pipes an object containing a nested object with three keys defined out-of-order through jshon -S to sort recursively, then extracts the nested object and prints its keys with -k, asserting the keys appear in alphabetical order, exercising libjansson's object representation under jshon's sort and extract chain.
jshon -F path -l reports the five-element array length when reading from a file Port / libjansson / usage-jshon-r20-file-flag-reads-array-length-five Passed
Writes [1,2,3,4,5] to a tempfile, runs jshon -F <path> -l, and asserts the printed length is 5, exercising libjansson's file-based JSON load path through jshon's -F non-manipulation flag with stdin closed.
jshon -n value -i key then -e key -u returns the inserted number as a string Port / libjansson / usage-jshon-r20-insert-number-then-extract-confirms-value Passed
Starts with the object {"a":1}, creates a JSON number 42 via -n, inserts it at key "b", then re-extracts -e b -u and asserts the result is "42", exercising libjansson's number value round-trip through jshon's nonstring/insert/extract chain.
jshon -e -1 -u returns the last array element's unstrung value Port / libjansson / usage-jshon-r20-negative-index-extract-last-array-value Passed
Pipes ["alpha","beta","gamma"] through jshon -e -1 -u and asserts the result is "gamma", exercising libjansson's array wraparound indexing via jshon's negative-index extraction.
jshon -e key -e key -l reports the length of a doubly-nested inner array Port / libjansson / usage-jshon-r20-nested-array-length-via-two-extracts Passed
Pipes {"a":{"b":[10,20,30,40,50]}} through jshon -e a -e b -l and asserts the printed length is 5, exercising libjansson's nested container traversal via jshon's chained extract followed by length-of-array.
jshon -Q -e missing emits empty stderr and a non-zero exit on a missing key Port / libjansson / usage-jshon-r20-quiet-flag-suppresses-stderr-on-missing-key Passed
Pipes {"a":1} through jshon -Q -e nonexistent capturing stderr, asserts the captured stderr is empty (quiet mode suppresses the diagnostic), and asserts the exit status is non-zero, exercising libjansson's lookup-miss path through jshon's quiet error-suppression flag.
jshon -a -e v -u emits the v field of each object in an array on separate lines Port / libjansson / usage-jshon-r21-across-array-of-objects-extract-each-v Passed
Pipes a JSON array of three objects each carrying a numeric "v" field through jshon -a -e v -u and asserts the captured output consists of exactly three lines with the values "10", "20", "30" in that order - locking in libjansson-backed jshon's across-then-extract pipeline that iterates an array and projects a per-element field.
jshon default output of a single-key object emits one space after the colon per line Port / libjansson / usage-jshon-r21-default-output-compact-no-spaces Passed
Pipes the JSON object {"k":1} through jshon (no flags) and asserts the captured output exactly equals the three-line representation "{\n \"k\": 1\n}\n" - locking in libjansson-backed jshon's default reformatting output: keys indented by a single space, a colon-space delimiter between key and value, and braces on their own lines.
jshon -e on an object with duplicate keys returns the last-defined value Port / libjansson / usage-jshon-r21-duplicate-key-last-wins Passed
Pipes a JSON object literal containing two entries with the same key "a" (mapped to 1 and 3 respectively) through jshon -e a -u and asserts the captured value equals exactly "3" - locking in libjansson's documented duplicate-key resolution where the later definition supersedes the earlier one in the parsed object.
jshon -F on a non-existent path exits nonzero with a stderr file-error message Port / libjansson / usage-jshon-r21-f-flag-missing-file-error Passed
Runs jshon -F /nonexistent/path against an unwritable path that cannot exist, captures stderr, asserts the exit code is nonzero and that the captured stderr contains both "unable to read file" and the literal target path - locking in libjansson-backed jshon's file-mode error reporting when the requested input is missing.
jshon -n "[]" -i empty creates an empty-array entry observable via -k Port / libjansson / usage-jshon-r21-insert-empty-array-then-keys Passed
Starts from an empty JSON object {}, pipes it through jshon -n "[]" -i empty -k to insert an empty array under key "empty" and then list the parent keys, asserts the captured single-line output equals exactly "empty" - locking in libjansson-backed jshon's pipeline for inserting a fresh empty array into an empty object via the -n container literal.
jshon -P strips jsonp wrapper around an array and -e extracts the second element Port / libjansson / usage-jshon-r21-jsonp-strip-array-payload Passed
Wraps a JSON array of three strings inside a "callback(...)" jsonp envelope, pipes it through jshon -P -e 1 -u, and asserts the captured output equals exactly "middle" - locking in libjansson's parser invocation after jshon's jsonp-strip pass when the inner payload is an array (the existing r11 jsonp test only covered an object payload).
jshon extracts an object value addressed by a key containing internal spaces Port / libjansson / usage-jshon-r21-key-with-spaces-extract-value Passed
Pipes a JSON object with the key "hello world" mapped to the integer 42 through jshon -e "hello world" -u and asserts the captured output equals exactly "42" - locking in libjansson's exact key matching when the key contains an internal ASCII space (existing r12 only covered the "key with spaces" extracted as a string value, not the integer-value path with an internal-space key).
jshon extracts the integer 9007199254740992 (2^53) without precision loss Port / libjansson / usage-jshon-r21-large-integer-2pow53-roundtrip Passed
Pipes the JSON array [9007199254740992] through jshon -e 0 -u and asserts the captured output equals exactly "9007199254740992" - locking in libjansson's integer parsing/round-tripping at the IEEE-754 double 2^53 boundary, well above prior tests that exercised only smaller large-integer values.
jshon -0 -a -u emits NUL-separated unstring tokens for an array of strings Port / libjansson / usage-jshon-r21-null-delimited-array-strings Passed
Pipes a JSON array of three short strings ["alpha","beta","gamma"] through jshon -0 -a -u and asserts the resulting byte stream is exactly the three strings each followed by a NUL byte (no trailing newline) - locking in libjansson-backed jshon's NUL-delimited emission mode when un-stringing across an array.
jshon -V validates well-formed input, exits zero, and reprints it Port / libjansson / usage-jshon-r21-v-validate-prints-input-and-zero-exit Passed
Pipes the JSON object {"a":1,"b":[true,null]} through jshon -V and asserts the command exits zero AND that the captured stdout contains "a", "b", "true", and "null" - locking in libjansson-backed jshon's -V validate path that confirms structural well-formedness while still re-emitting the parsed document.
jshon builds an array from scratch via -n -s -n -i append chaining Port / libjansson / usage-jshon-r3-build-array-incrementally Passed
Starts from an empty array via jshon -n '[]' and appends a string, a number, a boolean, and a null in sequence with repeated -s/-n + -i append, then verifies the final array length and the type of each appended element.
jshon -e on keys containing backslash, tab, and quote escape sequences Port / libjansson / usage-jshon-r3-escape-sequences-keys Passed
Constructs an object whose keys contain a JSON-escaped backslash, a JSON-escaped tab, and a JSON-escaped double quote, then asserts jshon -e accepts the decoded raw key strings and returns the matching values.
jshon -e walks five levels of nesting Port / libjansson / usage-jshon-r3-five-level-nested-extract Passed
Builds a JSON document nested five object levels deep and verifies jshon -e returns the matching subtree at every level, with the leaf -u producing the final string and intermediate -t reporting object at each level.
jshon -l counts a 200-element array Port / libjansson / usage-jshon-r3-large-array-200 Passed
Constructs a JSON array containing exactly 200 integers and verifies jshon -l reports 200, jshon -e at the boundary indices returns the expected values, and jshon -t reports array.
jshon walks object then array then object then key Port / libjansson / usage-jshon-r3-mixed-deep-walk Passed
Drills through an object that holds an array of objects, picks one entry by index, then extracts a leaf string key on the inner object and verifies the unstringed leaf as well as intermediate types.
jshon -t reports the right type for each element of a mixed-type array Port / libjansson / usage-jshon-r3-mixed-scalar-array-types Passed
Loads an array whose elements span string, number, true, false, and null, then asserts jshon -t at each index returns the type label that matches the underlying JSON scalar.
jshon -e on object keys that are numeric strings Port / libjansson / usage-jshon-r3-numeric-string-keys Passed
Builds an object whose keys are the string forms of integers ("1","2","3") and verifies jshon -e treats them as ordinary string keys, not array indices, returning the associated values via -u.
jshon -u prints numeric values without quotes Port / libjansson / usage-jshon-r3-unstring-number Passed
Applies jshon -u to integer, negative, fractional, and scientific JSON number values and verifies the bare digit form is emitted on stdout exactly as in the source document.
jshon -e on an object key containing whitespace Port / libjansson / usage-jshon-r3-whitespace-key Passed
Defines an object with a key that contains a literal space and asserts jshon -e accepts the key as a single argument and returns the matching value.
jshon -k piped through xargs back into jshon -e Port / libjansson / usage-jshon-r3-xargs-extract-keys Passed
Lists object keys with jshon -k, pipes them through xargs into a fresh jshon -e invocation per key, and confirms each per-key extraction returns the expected unstringed value.
jshon -e walks object then array index then field Port / libjansson / usage-jshon-r4-data-array-id-extract Passed
Builds {"data":[{"id":1},{"id":2}]} and verifies jshon -e data -e 1 -e id -u returns 2 while -e data -e 0 -e id -u returns 1, exercising mixed object/array descent at varying indices.
jshon -d removes an array element by position Port / libjansson / usage-jshon-r4-delete-array-index-by-position Passed
Deletes the middle element of [10,20,30,40] with jshon -d 1 and verifies the resulting array has length 3, that index 1 now holds the value previously at index 2, and that the deleted value 20 no longer appears at any surviving index.
jshon -k on empty object yields no lines Port / libjansson / usage-jshon-r4-empty-object-keys-no-output Passed
Runs jshon -k against {} and verifies the output has zero lines, distinguishing the empty-keys case from the empty-string-line case.
jshon -t on fractional literal reports number Port / libjansson / usage-jshon-r4-float-pi-type-number Passed
Wraps a fractional literal in an array (jshon rejects bare scalar roots), extracts it, and verifies jshon reports the type as number and -u round-trips the exact value unchanged. Uses 0.25, which is exactly representable in IEEE 754 binary64 so jshon's printf does not widen it to a long decimal expansion.
jshon -t on integer 0 reports number Port / libjansson / usage-jshon-r4-integer-zero-type-number Passed
Wraps integer 0 in a single-element array, descends with -e 0 -t, and verifies jshon classifies 0 as number while -u emits the literal 0.
jshon -k lists keys regardless of value type Port / libjansson / usage-jshon-r4-mixed-value-types-keys-only Passed
Lists keys of an object whose values span all JSON scalar and container types and verifies jshon -k emits only the key names exactly once each, with no value bytes leaking into the listing.
jshon manipulated output round-trips through disk Port / libjansson / usage-jshon-r4-output-to-disk-roundtrip Passed
Deletes a key with jshon and redirects the resulting JSON to a file, then reopens the file with jshon -F to verify the deletion survived the disk round-trip and that surviving keys still resolve to their original values.
jshon -e walks six levels of nesting Port / libjansson / usage-jshon-r4-six-level-nested-extract Passed
Builds a six-level deep object l1.l2.l3.l4.l5.l6 == "deepest" and verifies jshon -t reports object at every intermediate level, string at the leaf, and -u returns the leaf string verbatim.
jshon tolerates leading and trailing whitespace on stdin Port / libjansson / usage-jshon-r4-stdin-leading-trailing-whitespace Passed
Pipes a JSON object surrounded by leading newlines/spaces and trailing whitespace into jshon, and verifies the parser still extracts the nested value identically to the whitespace-stripped version.
jshon -l on unicode string reports UTF-8 byte length Port / libjansson / usage-jshon-r4-unicode-string-codepoint-length Passed
Stores a three-codepoint string containing an escaped e-acute ("a\\u00e9z", whose UTF-8 encoding is 4 bytes), verifies jshon -l reports 4 (jshon's documented "length" for strings is the strlen of the UTF-8 representation, not a codepoint count), and that -u emits exactly the 4 UTF-8 bytes followed by a newline.
jshon -t on each json type within a deeply nested array Port / libjansson / usage-jshon-r5-deep-mixed-types-per-index Passed
Walks into a deeply nested mixed-type array and queries jshon -t at each index, verifying that string, number, bool, null, array, and object are all reported correctly within the same document.
jshon -l on empty string value Port / libjansson / usage-jshon-r5-empty-string-length Passed
Extracts an empty string field and queries jshon -l on it, verifying that the reported byte length is exactly 0.
jshon -e on path with hyphenated keys Port / libjansson / usage-jshon-r5-extract-hyphenated-path Passed
Walks a nested object whose keys contain hyphens at multiple levels and verifies that jshon -e accepts the hyphenated key tokens and returns the leaf string intact.
jshon -e on object with numeric-looking string keys Port / libjansson / usage-jshon-r5-extract-numeric-string-keys Passed
Confirms that jshon -e treats numeric-looking object keys "0" and "1" as ordinary string keys (object lookup) rather than as array indices, and that the associated values resolve correctly.
jshon insert negative integer at array front Port / libjansson / usage-jshon-r5-insert-negative-integer Passed
Builds a fresh negative integer with jshon -n -1 and inserts it at index 0 of an existing array, verifying length grows by one, the new front element reads back as -1, and the previous head shifts to index 1.
jshon -k preserves object insertion order Port / libjansson / usage-jshon-r5-keys-insertion-order Passed
Constructs an object with a deliberately non-alphabetical insertion order and verifies that jshon -k emits the keys in that exact source order, line by line.
jshon multiple -d in sequence Port / libjansson / usage-jshon-r5-multiple-d-sequence Passed
Chains three -d deletes against the root object in a single jshon invocation and verifies that all three keys are removed while the surviving keys remain reachable.
jshon piped twice via stdout chain Port / libjansson / usage-jshon-r5-piped-twice-stdout-chain Passed
Pipes the output of one jshon invocation (extracting a sub-document) into a second jshon invocation, verifying that an emitted JSON sub-document is itself a valid input to jshon and that downstream extraction returns the expected leaf.
jshon output redirected to file then re-parsed Port / libjansson / usage-jshon-r5-redirect-to-file-and-reparse Passed
Captures jshon's emitted JSON sub-document via shell redirection into a file, then re-loads that file with jshon -F and verifies the round-tripped document still answers structural queries (type, length, key extract) consistently.
jshon -e on string containing JSON-like brackets Port / libjansson / usage-jshon-r5-string-with-bracket-content Passed
Reads a string value whose contents look like a JSON array literal ("[hello]") and verifies that jshon -e -u returns the raw bracketed string verbatim instead of attempting to parse it as a sub-document.
jshon chained -d a -d b -d c against root object Port / libjansson / usage-jshon-r6-chained-three-deletes Passed
Issues three consecutive -d deletes (a, b, c) in a single jshon invocation against a six-key object, then re-emits the surviving JSON and verifies that the three named keys are gone, the remaining three keys are intact, and -l reports length 3.
jshon -k on an array fails with parse error Port / libjansson / usage-jshon-r6-empty-array-keys-no-output Passed
Anchors the type and length of an empty array via jshon -t and -l, then confirms that jshon -k on an array (which has no keys, only indices) fails with non-zero exit and emits a parse-error diagnostic to stderr - the documented behavior that callers must distinguish keys-bearing objects from arrays before requesting -k.
jshon -e on first vs last element of an array Port / libjansson / usage-jshon-r6-first-vs-last-array-element Passed
Picks the same array's first element via -e 0 and its last element via -e <length-1>, asserting that the two extracted values are distinct, the lengths reported by -l match, and that types at both ends match expectations. Documents that positive-indexing both ends works (jshon does not support negative array indices).
jshon insert null at array index 1 Port / libjansson / usage-jshon-r6-insert-null-at-index Passed
Pushes a fresh null with jshon -n null and inserts it at index 1 of a four-element integer array, verifying that the inserted slot reports type null, the array length grows to five, and the previous index-1 element shifts right to index 2.
jshon insert true at array index 2 Port / libjansson / usage-jshon-r6-insert-true-at-index Passed
Pushes a fresh boolean true with jshon -n true and inserts it at index 2 of a four-element string array, verifying that -t at index 2 reports bool, the array length grows to five, and the previous index-2 string shifts right to index 3.
jshon -l counts a 500-element array Port / libjansson / usage-jshon-r6-large-array-500-length Passed
Builds a JSON array of 500 sequential integers (0..499), writes it to a file, and verifies jshon -F reports length 500, type array, and that boundary indices 0, 250, and 499 each unstring to their numeric value. Stress test extending the round-3 200-element baseline.
jshon -e on object with numeric-string and word-string keys Port / libjansson / usage-jshon-r6-mixed-integer-string-keys Passed
Constructs an object whose keys mix purely numeric strings ("1", "2", "10") with alphabetic words ("first", "second"), then verifies jshon -e treats every key as a string (since JSON object keys are always strings) and returns the matching values for both flavors.
jshon round-trip emits stable canonical formatting Port / libjansson / usage-jshon-r6-roundtrip-formatting-stable Passed
Feeds the same JSON document through jshon twice using two different input whitespace shapes (compact and pretty-printed with newlines and tabs) and verifies that the two normalized outputs are byte-for-byte identical. jshon's emit format does not preserve original whitespace, but it must be deterministic across whitespace variants of the same logical document.
jshon -u decodes string values containing escaped tabs and newlines Port / libjansson / usage-jshon-r6-tab-newline-string-values Passed
Reads two object fields whose JSON-encoded string values contain escape sequences \t (tab) and \n (newline), then verifies that jshon -u emits the decoded literal control character so the byte length and surrounding text match expectations.
jshon -t after -d at a deeply nested location Port / libjansson / usage-jshon-r6-type-after-deep-delete Passed
Walks four levels deep into a nested object, deletes one key from the innermost object, then asks for -t at the parent, verifying the parent is still an object, its length dropped from 3 to 2, and the deleted key no longer resolves while siblings still do.
jshon -a iterates element types across an array Port / libjansson / usage-jshon-r7-across-array-types Passed
Applies jshon -a -t against a heterogeneous five-element root array and verifies that the across operator emits exactly five lines of type labels in array order, matching number, string, bool, null, and object respectively.
jshon -a -e id -u plucks one field from each record Port / libjansson / usage-jshon-r7-across-extract-field Passed
Applies the across operator to an array of three uniform record objects, extracts the id field from each, unstrings it, and verifies the three id strings emerge in input order on three separate lines.
jshon -a -u unstrings every array element Port / libjansson / usage-jshon-r7-across-unstring-strings Passed
Streams a homogeneous string array through jshon -a -u and verifies the output contains exactly the four raw (unquoted) strings, one per line, in the original array order, exercising the across operator combined with unstring rather than per-index extracts.
jshon builds an array from -n array via repeated -i append Port / libjansson / usage-jshon-r7-build-array-from-empty Passed
Starts with jshon -n array and appends three numeric elements using -n <num> -i append, then verifies the resulting array has length three with values 7, 8, 9 at positions 0, 1, 2 respectively.
jshon builds an object incrementally with -s and -i key Port / libjansson / usage-jshon-r7-build-object-with-s-i Passed
Starts from an empty object via jshon -n object, pushes string scalars with -s and inserts each at a named key with -i, building a three-key object whose key list, length, and per-key unstring values are all confirmed against the assembled document.
jshon delete a key and re-insert with new value Port / libjansson / usage-jshon-r7-delete-then-reinsert-key Passed
Deletes an existing object key with -d, pushes a new string with -s, re-inserts it under the same key name with -i, and verifies the final object still has the original three keys but the targeted key now carries the replacement value.
jshon insert into a nested array via -e then -i append Port / libjansson / usage-jshon-r7-insert-into-nested-array Passed
Descends into the nested array under key items with -e, pushes a new number with -n 99, appends it with -i append, and verifies the emitted document is the modified items array of length four whose tail element is 99 while head element is preserved.
jshon -k line count matches -l for a 50-key object Port / libjansson / usage-jshon-r7-keys-count-via-wc Passed
Generates a 50-entry JSON object on the fly via shell, lists its keys with jshon -k piped to wc -l, asks jshon -l for the length on the same input, and verifies the two independent counts agree at exactly 50.
jshon -e values -e 1 -p -l reports parent array length Port / libjansson / usage-jshon-r7-nested-array-pop-length Passed
Descends into a nested integer array element, pops with -p, and asks for the array length, verifying the navigator reports the size of the array (5) rather than the previously selected scalar at index 1.
jshon -t reports the canonical label for every JSON shape via -F Port / libjansson / usage-jshon-r7-type-survey-across-shapes Passed
Wraps each scalar/container shape inside a one-element array document, then descends with jshon -F file -e 0 -t and asserts the type label printed for object, array, string, integer number, fractional number, true bool, false bool, and null all match the expected jshon vocabulary.
jshon -V makes intermediate edits non-propagating without explicit re-insertion Port / libjansson / usage-jshon-r8-by-value-edit-history Passed
Demonstrates the documented by-reference vs by-value distinction: without -V the chain -e c -n 7 -i d -p mutates the inner object so c.d becomes 7, while with -V the same chain leaves c.d unchanged at the original 5 because the popped intermediate is not re-inserted, and explicitly re-inserting with -i c under -V finally propagates the change.
jshon -C makes missing-key extraction recover with a null on the stack Port / libjansson / usage-jshon-r8-continue-missing-key-yields-null Passed
Without -C, jshon -e on an absent object key aborts with a non-zero exit; with -C, the same extraction pushes a null onto the edit stack so a following -t reports the literal type label null and the invocation succeeds, demonstrating the documented continue-on-error semantics.
jshon walks seven nested object levels and unwinds with chained -p Port / libjansson / usage-jshon-r8-deep-seven-level-walk Passed
Drills through seven nested object levels with successive -e calls to fetch the leaf string at l1.l2.l3.l4.l5.l6.l7, then re-runs the descent and pops back four times with chained -p to confirm the navigator lands on level l3 whose only key is l4, exercising deep navigation and stack-unwind balance.
jshon -a maps over an empty top-level array as a silent no-op Port / libjansson / usage-jshon-r8-empty-array-across-noop Passed
Applies the across operator to a top-level empty array and a nested empty array under a key, verifying the inner action -t produces no output lines and exits zero in both cases, while -k against the empty array still fails as documented because keys is undefined for arrays of any size.
jshon -n null -i key inserts the literal null into an object Port / libjansson / usage-jshon-r8-insert-null-at-key Passed
Starts from an empty object via jshon -n object, pushes a null with -n null, inserts it at key marker, and verifies the resulting document has length one, lists key marker on a -k pass, reports type null at that key on a -t pass, and that the long-form value null is identical to its abbreviation -n n.
jshon -0 emits NUL-delimited unstring output instead of newline-delimited Port / libjansson / usage-jshon-r8-null-delimiter-unstring Passed
Maps -u across an array of strings with and without -0 and inspects the raw byte stream, asserting that without -0 jshon separates entries with 0x0a newlines while with -0 the same payload is separated with 0x00 null bytes, and that xargs -0 can recover the values intact when piped through the null-delimited form.
jshon -e treats a numeric-looking object key as a string and an array index as integer Port / libjansson / usage-jshon-r8-numeric-string-key-vs-array-index Passed
Constructs an object whose keys are the digit strings 123 and 456 plus an array of three numbers, and verifies that jshon -e 123 against the object returns the value bound to the string key while jshon -e 1 against the array returns the second element by integer index, demonstrating that the same -e argument is interpreted by container type rather than by the literal characters supplied.
jshon -Q silences error reporting while preserving the failing exit Port / libjansson / usage-jshon-r8-quiet-suppresses-stderr Passed
Compares jshon -e on a missing key with and without -Q, asserting that the bare invocation writes a non-empty error to stderr while the -Q variant emits nothing on stderr, and that both invocations still exit non-zero so callers can detect the failure without parsing diagnostics.
jshon -F /dev/stdin reads document delivered through a here-document Port / libjansson / usage-jshon-r8-stdin-via-heredoc Passed
Feeds a small object document through a quoted bash here-document into jshon -F /dev/stdin and confirms the parser accepts the synthetic stdin path, returning the expected top-level type, the deep-nested null type label, and the unstring of a string field, exercising the file-mode reader against a non-regular input.
jshon round-trips a 4000-character string value through unstring Port / libjansson / usage-jshon-r8-very-long-string-roundtrip Passed
Builds a JSON object whose value is a single ASCII string of 4000 X characters, parses it through jshon, extracts the value with -e -u, and verifies the unstring output is exactly 4000 bytes plus the trailing newline so libjansson preserves long string payloads without truncation, splitting, or escape expansion.
jshon -e then -l reports nested array length Port / libjansson / usage-jshon-r9-array-extract-then-length Passed
Extracts a nested array via -e and pipes through -l to verify the inner length matches the inserted element count.
jshon array of objects aggregate -a -e Port / libjansson / usage-jshon-r9-array-of-objects-aggregate Passed
Iterates an array of objects with -a -e to extract one field per object and verifies each extracted value appears in the output.
jshon -a on empty array produces no output Port / libjansson / usage-jshon-r9-empty-array-aggregate-noop Passed
jshon -k preserves input key order Port / libjansson / usage-jshon-r9-keys-sorted-by-input Passed
Builds an object whose keys are inserted in non-alphabetical order and verifies jshon -k emits them in input insertion order.
jshon preserves large positive integer Port / libjansson / usage-jshon-r9-large-integer-roundtrip Passed
Reads a JSON document containing a 10-digit positive integer and verifies jshon -u emits the same integer literal.
jshon nested object key extract Port / libjansson / usage-jshon-r9-nested-object-key-extract Passed
Extracts a string value from a three-level nested object using chained -e and -u and verifies the leaf string is rendered verbatim.
jshon -p reads after pop Port / libjansson / usage-jshon-r9-pop-array-back Passed
Pops the last element from an array with -p and verifies the resulting array length matches the expected reduced count.
jshon -t reports string type Port / libjansson / usage-jshon-r9-stat-string-type Passed
jshon -u preserves embedded double quote Port / libjansson / usage-jshon-r9-string-with-quote-escaped Passed
Extracts a string field whose value contains an escaped double quote and verifies the rendered output keeps the literal quote character.
jshon -u preserves embedded tab in string Port / libjansson / usage-jshon-r9-string-with-tab-unstring Passed
Extracts a string field containing an embedded tab via -u and verifies the rendered output contains an actual tab character.
jshon reads a string field Port / libjansson / usage-jshon-read-field Passed
jshon records length Port / libjansson / usage-jshon-records-length Passed
jshon reports root array length Port / libjansson / usage-jshon-root-array-length Passed
jshon reports root array type Port / libjansson / usage-jshon-root-array-type Passed
jshon rejects root bool document Port / libjansson / usage-jshon-root-bool-type Passed
Runs jshon against a root boolean document and verifies the client rejects primitive-root JSON input.
jshon root key list Port / libjansson / usage-jshon-root-key-list Passed
jshon rejects root null document Port / libjansson / usage-jshon-root-null-type Passed
Runs jshon against a root null document and verifies the client rejects primitive-root JSON input.
jshon root number type Port / libjansson / usage-jshon-root-number-type Passed
jshon root object type Port / libjansson / usage-jshon-root-object-type Passed
jshon rejects root string document Port / libjansson / usage-jshon-root-string-type Passed
Runs jshon against a root JSON string and verifies the client rejects primitive-root JSON input.
jshon scalar type survey Port / libjansson / usage-jshon-scalar-type-survey Passed
jshon scientific number field Port / libjansson / usage-jshon-scientific-number-field Passed
jshon set top-level container types Port / libjansson / usage-jshon-set-container-types Passed
Loads a JSON object and a JSON array as the top-level value through jshon -n and confirms the type and length each match the loaded document.
jshon set top-level scalar types Port / libjansson / usage-jshon-set-scalar-types Passed
Uses jshon -n to load each JSON scalar shape (string, number, true, false, null) as the document and verifies the type label reported by -t.
jshon -S sorts object keys in output Port / libjansson / usage-jshon-sort-keys-output Passed
Re-emits a JSON object through jshon -S and verifies the listed keys are produced in lexicographic order regardless of the input ordering.
jshon string with spaces Port / libjansson / usage-jshon-string-with-space Passed
jshon string with spaces field Port / libjansson / usage-jshon-string-with-spaces-field Passed
Reads a JSON string field containing whitespace with jshon and verifies the emitted phrase preserves the embedded space.
jshon third array value Port / libjansson / usage-jshon-third-array-value Passed
jshon true field Port / libjansson / usage-jshon-true-field Passed
jshon reports value type Port / libjansson / usage-jshon-type-check Passed
jshon decodes escaped e-acute Port / libjansson / usage-jshon-unicode-eacute-decode Passed
Reads an escaped é inside a JSON string and verifies jshon -u emits the UTF-8 e-acute byte sequence.
jshon Unicode escape string Port / libjansson / usage-jshon-unicode-escape-string Passed
jshon unicode string Port / libjansson / usage-jshon-unicode-string Passed
Extracts a JSON string containing escaped Unicode through jshon and verifies the decoded text is emitted.
jshon zero number value Port / libjansson / usage-jshon-zero-number-value Passed
CVE-2013-6401 libjansson regression Port / libjansson / cve-2013-6401 Passed
Asserts that inserting 20000 distinct keys into a json_object completes in linear time (well under 2s), confirming the hash seed is randomized rather than the pre-2.6 deterministic lookup3 seed that allowed hash-collision CPU DoS.
CVE-2016-4425 libjansson regression Port / libjansson / cve-2016-4425 Passed
Asserts that json_loads enforces JSON_PARSER_MAX_DEPTH for deeply nested arrays, returning a parse error rather than blowing the stack via uncontrolled recursion.