1
1
mirror of https://github.com/wader/fq.git synced 2024-11-23 09:56:07 +03:00
fq/pkg/interp/testdata/inputs.fqtest
Mattias Wadman c93301fc70 raw,bits,bytes: Replace raw format with bits and bytes format that decode to a binary
raw format was a hack to skip decoding to be able to get a binary using tobyte etc.
Now you can do fq -d bytes ... instead of fq -d raw 'tobytes | ...'
2022-11-20 19:51:12 +01:00

103 lines
1.9 KiB
Plaintext

/a:
a
/b:
b
/c:
c
# TODO: use test format
$ fq -d mp3_frame todescription a b c
"a"
"b"
"c"
$ fq -d mp3_frame '(.,inputs) | todescription' a b c
"a"
"b"
"c"
$ fq -d mp3_frame '(.,input,input,input) | try todescription catch .' a b c
"a"
"b"
"c"
exitcode: 5
stderr:
error: c: break
$ fq -d mp3_frame -n '(.,inputs) | try todescription catch .' a b c
"expected decode value but got: null (null)"
"a"
"b"
"c"
$ fq -d mp3_frame -n 'inputs | try todescription catch .' a b c
"a"
"b"
"c"
$ fq -d mp3_frame -n '[inputs | try todescription catch .]' a b c
[
"a",
"b",
"c"
]
$ fq -d mp3_frame -n '(input,input,input,input) | todescription' a b c
"a"
"b"
"c"
exitcode: 5
stderr:
error: c: break
$ fq -d mp3_frame input_filename
"<stdin>"
stdin:
test
$ fq -d mp3_frame input_filename a b c
"a"
"b"
"c"
$ fq -d mp3_frame input_filename a non-existing c
"a"
"c"
exitcode: 2
stderr:
error: non-existing: no such file or directory
$ fq -d mp3_frame '(' a b c
exitcode: 3
stderr:
error: arg:1:1: unexpected EOF
$ fq -d mp3_frame bla a b c
exitcode: 3
stderr:
error: arg: function not defined: bla/0
$ fq -d mp3_frame '1+"a"' a b c
exitcode: 5
stderr:
error: a: cannot add: number (1) and string ("a")
error: b: cannot add: number (1) and string ("a")
error: c: cannot add: number (1) and string ("a")
$ fq -s -d mp3_frame '[.[] | todescription]' a b c
[
"a",
"b",
"c"
]
$ fq -n -s -d mp3_frame . a b c
null
$ fq . a
exitcode: 4
stderr:
error: a: probe: failed to decode: try fq -d FORMAT to force format, see fq -h formats for list
$ fq -i -d mp3_frame . a b c
mp3_frame!, ...[0:3][]> ._format
"mp3_frame"
"mp3_frame"
"mp3_frame"
mp3_frame!, ...[0:3][]> ^D
$ fq -i -s -d mp3_frame . a b c
[mp3_frame!, ...][0:3]> .[]._format
"mp3_frame"
"mp3_frame"
"mp3_frame"
[mp3_frame!, ...][0:3]> ^D
$ fq
exitcode: 4
stdin:
test
stderr:
error: <stdin>: probe: failed to decode: try fq -d FORMAT to force format, see fq -h formats for list