1
1
mirror of https://github.com/wader/fq.git synced 2024-12-26 15:02:28 +03:00
fq/pkg/interp/testdata/inputs.fqtest

102 lines
1.6 KiB
Plaintext
Raw Normal View History

2020-06-08 03:29:51 +03:00
/a:
a
/b:
b
/c:
c
$ fq -d raw todescription a b c
"a"
"b"
"c"
$ fq -d raw '(.,inputs) | todescription' a b c
"a"
"b"
"c"
$ fq -d raw '(.,input,input,input) | try todescription catch .' a b c
"a"
"b"
"c"
2020-06-08 03:29:51 +03:00
exitcode: 5
stderr:
error: c: break
$ fq -d raw -n '(.,inputs) | try todescription catch .' a b c
"expected decode value but got: null (null)"
"a"
"b"
"c"
$ fq -d raw -n 'inputs | try todescription catch .' a b c
"a"
"b"
"c"
$ fq -d raw -n '[inputs | try todescription catch .]' a b c
2020-06-08 03:29:51 +03:00
[
"a",
"b",
"c"
2020-06-08 03:29:51 +03:00
]
$ fq -d raw -n '(input,input,input,input) | todescription' a b c
"a"
"b"
"c"
2020-06-08 03:29:51 +03:00
exitcode: 5
stderr:
error: c: break
$ fq -d raw input_filename
"<stdin>"
stdin:
test
$ fq -d raw input_filename a b c
"a"
"b"
"c"
$ fq -d raw input_filename a non-existing c
"a"
"c"
2020-06-08 03:29:51 +03:00
exitcode: 2
stderr:
error: non-existing: no such file or directory
$ fq -d raw '(' a b c
2020-06-08 03:29:51 +03:00
exitcode: 3
stderr:
error: arg:1:1: unexpected EOF
$ fq -d raw bla a b c
2020-06-08 03:29:51 +03:00
exitcode: 3
stderr:
error: arg: function not defined: bla/0
$ fq -d raw '1+"a"' a b c
2020-06-08 03:29:51 +03:00
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 raw '[.[] | todescription]' a b c
2020-06-08 03:29:51 +03:00
[
"a",
"b",
"c"
2020-06-08 03:29:51 +03:00
]
$ fq -n -s -d raw . a b c
2020-06-08 03:29:51 +03:00
null
$ fq . a
2020-06-08 03:29:51 +03:00
exitcode: 4
stderr:
error: a: probe: failed to decode (try -d FORMAT)
$ fq -i -d raw . a b c
raw, ...[0:3][]> ._format
2021-08-18 22:03:05 +03:00
"raw"
"raw"
"raw"
raw, ...[0:3][]> ^D
$ fq -i -s -d raw . a b c
[raw, ...][0:3]> .[]._format
2021-08-18 22:03:05 +03:00
"raw"
"raw"
"raw"
[raw, ...][0:3]> ^D
$ fq
exitcode: 4
stdin:
test
stderr:
error: <stdin>: probe: failed to decode (try -d FORMAT)