1
1
mirror of https://github.com/wader/fq.git synced 2024-12-27 15:42:07 +03:00
fq/pkg/interp/testdata/incudepath.fqtest
Mattias Wadman 377af133e0 fqtest: Cleanup path usage
Make cwd for a test script the directory where the script is.
Use relative paths
2022-05-21 20:03:25 +02:00

29 lines
652 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 -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 ")"