mirror of
https://github.com/wader/fq.git
synced 2024-12-25 22:34:14 +03:00
377af133e0
Make cwd for a test script the directory where the script is. Use relative paths
29 lines
652 B
Plaintext
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 ")"
|