1
1
mirror of https://github.com/wader/fq.git synced 2024-12-28 08:02:28 +03:00
fq/pkg/interp/testdata/incudepath.fqtest
Mattias Wadman e238f292af repl: Speedup multi input to sub-repl
Rewrite non-sub-repl queries as "q" -> ".[] | q" and pass in inputs as array.
Before each input did an eval.

Also fixup error message a bit, skip line:column when they dont make sense.
2022-02-18 01:13:45 +01:00

27 lines
617 B
Plaintext

/library/a.jq:
def a: "a";
/config/has_error.jq:
)
$ fq -L /library -n 'include "a"; a'
"a"
$ fq --include-path /library -n 'include "a"; a'
"a"
$ fq -L /wrong -L /library -n 'include "a"; a'
"a"
$ fq -n 'include "/library/a"; a'
"a"
$ fq -L /wrong -n 'include "a"; a'
exitcode: 3
stderr:
error: arg: open a.jq: file does not exist
$ fq -n 'include "@config/a";'
exitcode: 3
stderr:
error: arg: open testdata/config/a.jq: no such file or directory
$ fq -n 'include "@config/missing?";'
null
$ fq -n 'include "@config/has_error?";'
exitcode: 3
stderr:
error: arg: /config/has_error.jq:1:1: parse: unexpected token ")"