1
1
mirror of https://github.com/wader/fq.git synced 2024-12-27 15:42:07 +03:00
fq/pkg/interp/testdata/value_null.fqtest
Mattias Wadman 0c7fa090b0 gojq: Initial update support
decode value give no updateable error
JQValue json value tries to replicate behaveior
2021-09-12 13:08:50 +02:00

109 lines
3.1 KiB
Plaintext

/test.mp3:
$ fq -i -d mp3 . /test.mp3
mp3> .headers[0].padding | ., tovalue, type, length?
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |
0x20| 00 00 00 00 00 00 00 00 00 00 | .......... |.headers[0].padding: Correct (none) (zero padding)
null
"null"
0
mp3> .headers[0].padding[0] | ., type, length?
error: expected an array but got: null
mp3> .headers[0].padding[-1000] | ., type, length?
error: expected an array but got: null
mp3> .headers[0].padding[1000] | ., type, length?
error: expected an array but got: null
mp3> .headers[0].padding[1:3] | ., type, length?
error: expected an array but got: null
mp3> .headers[0].padding[0:-1] | ., type, length?
error: expected an array but got: null
mp3> .headers[0].padding[-1000:2000] | ., type, length?
error: expected an array but got: null
mp3> .headers[0].padding["test"] | ., type, length?
error: expected an object but got: null
mp3> [.headers[0].padding[]] | type, length?
error: cannot iterate over: null
mp3> .headers[0].padding | keys
error: keys cannot be applied to: null
mp3> .headers[0].padding | has("a")
error: has cannot be applied to: null
mp3> .headers[0].padding | has(0)
error: has cannot be applied to: null
mp3> .headers[0].padding | type
"null"
mp3> .headers[0].padding | tonumber
error: tonumber cannot be applied to: null
mp3> .headers[0].padding | tostring
"null"
mp3> .headers[0].padding + ""
""
mp3> .headers[0].padding + 1
1
mp3> .headers[0].padding._start | ., type, length?
280
"number"
280
mp3> .headers[0].padding._stop | ., type, length?
360
"number"
360
mp3> .headers[0].padding._len | ., type, length?
80
"number"
80
mp3> .headers[0].padding._name | ., type, length?
"padding"
"string"
7
mp3> .headers[0].padding._symbol | ., type, length?
"Correct"
"string"
7
mp3> .headers[0].padding._description | ., type, length?
"zero padding"
"string"
12
mp3> .headers[0].padding._path | ., type, length?
[
"headers",
0,
"padding"
]
"array"
3
mp3> .headers[0].padding._bits | ., type, length?
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |
0x0|00 00 00 00 00 00 00 00 00 00 |.......... |
<80 bits>
"buffer"
80
mp3> .headers[0].padding._bytes | ., type, length?
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |
0x0|00 00 00 00 00 00 00 00 00 00 |.......... |
<10 bytes>
"buffer"
10
mp3> .headers[0].padding._error | ., type, length?
null
"null"
0
mp3> .headers[0].padding._unknown | ., type, length?
false
"boolean"
mp3> .headers[0].padding.a = 1
error: expected an object but got: null
mp3> .headers[0].padding[0] = 1
error: expected an array but got: null
mp3> .headers[0].padding.a |= empty
error: expected an object but got: null
mp3> .headers[0].padding[0] |= empty
error: expected an array but got: null
mp3> .headers[0].padding | setpath(["a"]; 1)
error: expected an object with key "a" but got: null
mp3> .headers[0].padding | setpath([0]; 1)
error: expected an array with index 0 but got: null
mp3> .headers[0].padding | delpaths([["a"]])
error: expected an object with key "a" but got: null
mp3> .headers[0].padding | delpaths([[0]])
error: expected an array with index 0 but got: null
mp3> ^D