diff options
author | Nicolas Williams <nico@cryptonector.com> | 2019-03-21 23:58:55 -0500 |
---|---|---|
committer | Nicolas Williams <nico@cryptonector.com> | 2019-03-24 23:19:09 -0500 |
commit | c72ed135e4f1b5a02a8fb3f6cd46f27513ecab2a (patch) | |
tree | 018922dcd6b5ee3671e8a7f710c06f361c3f4378 /tests | |
parent | 3ea0199e031e98e92670a25e4323bd711005b5db (diff) |
Allow keywords in more places (fix #1868)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/jq.test | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/jq.test b/tests/jq.test index af3c1a9f..53a462b3 100644 --- a/tests/jq.test +++ b/tests/jq.test @@ -1662,3 +1662,14 @@ true builtins|any(.[:1] == "_") null false + +# Test ability to use keywords +(.[] as $kw | "\"{\($kw)} as $\($kw) | $\($kw) | {$\($kw)} | {\($kw):.\($kw)}\""|eval|empty),null +["as","def","module","import","include","if","then","else","elif","end","reduce","foreach","and","or","try","catch","label","break","__loc__"] +null + +(.[] as $kw | "\"def f($\($kw)): $\($kw); f(.)\""|eval|empty),null +["as","def","module","import","include","if","then","else","elif","end","reduce","foreach","and","or","try","catch","label","break","__loc__"] +null + + |