@port-labs/jq-node-bindings 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/binding.gyp +3 -3
- package/configure +8 -6
- package/deps/jq/.travis.yml +184 -35
- package/deps/jq/AUTHORS +31 -30
- package/deps/jq/COPYING +2 -2
- package/deps/jq/KEYS +8 -0
- package/deps/jq/Makefile.am +85 -70
- package/deps/jq/NEWS +5 -4
- package/deps/jq/README.md +18 -9
- package/deps/jq/appveyor.yml +53 -0
- package/deps/jq/compile-ios.sh +5 -5
- package/deps/jq/config/m4/check-math-func.m4 +7 -2
- package/deps/jq/configure.ac +130 -68
- package/deps/jq/docs/Rakefile +14 -135
- package/deps/jq/docs/Rakefile.manual +49 -0
- package/deps/jq/docs/Rakefile.website +76 -0
- package/deps/jq/docs/content/2.download/default.yml +115 -39
- package/deps/jq/docs/content/3.manual/manual.yml +641 -231
- package/deps/jq/docs/content/3.manual/v1.3/manual.yml +130 -130
- package/deps/jq/docs/content/3.manual/v1.4/manual.yml +160 -160
- package/deps/jq/docs/content/3.manual/v1.5/manual.yml +2878 -0
- package/deps/jq/docs/content/3.manual/v1.6/manual.yml +3287 -0
- package/deps/jq/docs/content/index/index.yml +28 -6
- package/deps/jq/docs/public/.htaccess +2 -2
- package/deps/jq/docs/public/css/base.scss +141 -59
- package/deps/jq/docs/public/js/manual-search.js +52 -0
- package/deps/jq/docs/site.yml +1 -10
- package/deps/jq/docs/templates/default.liquid +10 -10
- package/deps/jq/docs/templates/index.liquid +45 -32
- package/deps/jq/docs/templates/manual.liquid +67 -90
- package/deps/jq/docs/templates/shared/_footer.liquid +10 -5
- package/deps/jq/docs/templates/shared/_head.liquid +17 -12
- package/deps/jq/docs/templates/shared/_navbar.liquid +27 -0
- package/deps/jq/jq.1.prebuilt +523 -139
- package/deps/jq/modules/oniguruma/AUTHORS +1 -0
- package/deps/jq/modules/oniguruma/CMakeLists.txt +86 -0
- package/deps/jq/modules/oniguruma/COPYING +28 -0
- package/deps/jq/modules/oniguruma/ChangeLog +0 -0
- package/deps/jq/modules/oniguruma/HISTORY +2138 -0
- package/deps/jq/modules/oniguruma/Makefile.am +33 -0
- package/deps/jq/modules/oniguruma/NEWS +0 -0
- package/deps/jq/modules/oniguruma/README +189 -0
- package/deps/jq/modules/oniguruma/README.ja +195 -0
- package/deps/jq/modules/oniguruma/README.md +203 -0
- package/deps/jq/modules/oniguruma/cmake/dist.cmake +321 -0
- package/deps/jq/modules/oniguruma/compile +348 -0
- package/deps/jq/modules/oniguruma/config.guess +1754 -0
- package/deps/jq/modules/oniguruma/config.sub +1890 -0
- package/deps/jq/modules/oniguruma/configure.ac +87 -0
- package/deps/jq/modules/oniguruma/contributed/libfuzzer-onig.cpp +31 -0
- package/deps/jq/modules/oniguruma/depcomp +791 -0
- package/deps/jq/modules/oniguruma/dist.info +10 -0
- package/deps/jq/modules/oniguruma/doc/API +660 -0
- package/deps/jq/modules/oniguruma/doc/API.ja +667 -0
- package/deps/jq/modules/oniguruma/doc/FAQ +12 -0
- package/deps/jq/modules/oniguruma/doc/FAQ.ja +22 -0
- package/deps/jq/modules/oniguruma/doc/RE +436 -0
- package/deps/jq/modules/oniguruma/doc/RE.ja +448 -0
- package/deps/jq/modules/oniguruma/doc/UNICODE_PROPERTIES +698 -0
- package/deps/jq/modules/oniguruma/index.html +181 -0
- package/deps/jq/modules/oniguruma/index_ja.html +184 -0
- package/deps/jq/modules/oniguruma/install-sh +541 -0
- package/deps/jq/modules/oniguruma/m4/.whatever +0 -0
- package/deps/jq/modules/oniguruma/make_win32.bat +3 -0
- package/deps/jq/modules/oniguruma/make_win64.bat +3 -0
- package/deps/jq/modules/oniguruma/missing +215 -0
- package/deps/jq/modules/oniguruma/onig-config.in +78 -0
- package/deps/jq/modules/oniguruma/oniguruma.pc.cmake.in +13 -0
- package/deps/jq/modules/oniguruma/oniguruma.pc.in +14 -0
- package/deps/jq/modules/oniguruma/sample/CMakeLists.txt +28 -0
- package/deps/jq/modules/oniguruma/sample/Makefile.am +34 -0
- package/deps/jq/modules/oniguruma/sample/bug_fix.c +131 -0
- package/deps/jq/modules/oniguruma/sample/crnl.c +127 -0
- package/deps/jq/modules/oniguruma/sample/encode.c +308 -0
- package/deps/jq/modules/oniguruma/sample/listcap.c +110 -0
- package/deps/jq/modules/oniguruma/sample/names.c +75 -0
- package/deps/jq/modules/oniguruma/sample/posix.c +96 -0
- package/deps/jq/modules/oniguruma/sample/scan.c +88 -0
- package/deps/jq/modules/oniguruma/sample/simple.c +59 -0
- package/deps/jq/modules/oniguruma/sample/sql.c +76 -0
- package/deps/jq/modules/oniguruma/sample/syntax.c +76 -0
- package/deps/jq/modules/oniguruma/sample/user_property.c +87 -0
- package/deps/jq/modules/oniguruma/src/Makefile.am +58 -0
- package/deps/jq/modules/oniguruma/src/Makefile.windows +183 -0
- package/deps/jq/modules/oniguruma/src/ascii.c +61 -0
- package/deps/jq/modules/oniguruma/src/big5.c +190 -0
- package/deps/jq/modules/oniguruma/src/config.h.cmake.in +71 -0
- package/deps/jq/modules/oniguruma/src/config.h.win32 +84 -0
- package/deps/jq/modules/oniguruma/src/config.h.win64 +84 -0
- package/deps/jq/modules/oniguruma/src/cp1251.c +203 -0
- package/deps/jq/modules/oniguruma/src/euc_jp.c +310 -0
- package/deps/jq/modules/oniguruma/src/euc_jp_prop.c +158 -0
- package/deps/jq/modules/oniguruma/src/euc_jp_prop.gperf +27 -0
- package/deps/jq/modules/oniguruma/src/euc_kr.c +188 -0
- package/deps/jq/modules/oniguruma/src/euc_tw.c +171 -0
- package/deps/jq/modules/oniguruma/src/gb18030.c +538 -0
- package/deps/jq/modules/oniguruma/src/gperf_fold_key_conv.py +67 -0
- package/deps/jq/modules/oniguruma/src/gperf_unfold_key_conv.py +55 -0
- package/deps/jq/modules/oniguruma/src/iso8859_1.c +275 -0
- package/deps/jq/modules/oniguruma/src/iso8859_10.c +242 -0
- package/deps/jq/modules/oniguruma/src/iso8859_11.c +99 -0
- package/deps/jq/modules/oniguruma/src/iso8859_13.c +231 -0
- package/deps/jq/modules/oniguruma/src/iso8859_14.c +244 -0
- package/deps/jq/modules/oniguruma/src/iso8859_15.c +238 -0
- package/deps/jq/modules/oniguruma/src/iso8859_16.c +240 -0
- package/deps/jq/modules/oniguruma/src/iso8859_2.c +238 -0
- package/deps/jq/modules/oniguruma/src/iso8859_3.c +238 -0
- package/deps/jq/modules/oniguruma/src/iso8859_4.c +240 -0
- package/deps/jq/modules/oniguruma/src/iso8859_5.c +229 -0
- package/deps/jq/modules/oniguruma/src/iso8859_6.c +99 -0
- package/deps/jq/modules/oniguruma/src/iso8859_7.c +225 -0
- package/deps/jq/modules/oniguruma/src/iso8859_8.c +99 -0
- package/deps/jq/modules/oniguruma/src/iso8859_9.c +231 -0
- package/deps/jq/modules/oniguruma/src/koi8.c +253 -0
- package/deps/jq/modules/oniguruma/src/koi8_r.c +215 -0
- package/deps/jq/modules/oniguruma/src/make_unicode_fold.sh +22 -0
- package/deps/jq/modules/oniguruma/src/make_unicode_fold_data.py +306 -0
- package/deps/jq/modules/oniguruma/src/make_unicode_property.sh +18 -0
- package/deps/jq/modules/oniguruma/src/make_unicode_property_data.py +545 -0
- package/deps/jq/modules/oniguruma/src/mktable.c +1184 -0
- package/deps/jq/modules/oniguruma/src/onig_init.c +45 -0
- package/deps/jq/modules/oniguruma/src/oniggnu.h +85 -0
- package/deps/jq/modules/oniguruma/src/onigposix.h +169 -0
- package/deps/jq/modules/oniguruma/src/oniguruma.h +841 -0
- package/deps/jq/modules/oniguruma/src/regcomp.c +6300 -0
- package/deps/jq/modules/oniguruma/src/regenc.c +917 -0
- package/deps/jq/modules/oniguruma/src/regenc.h +243 -0
- package/deps/jq/modules/oniguruma/src/regerror.c +393 -0
- package/deps/jq/modules/oniguruma/src/regexec.c +3856 -0
- package/deps/jq/modules/oniguruma/src/regext.c +202 -0
- package/deps/jq/modules/oniguruma/src/reggnu.c +147 -0
- package/deps/jq/modules/oniguruma/src/regint.h +779 -0
- package/deps/jq/modules/oniguruma/src/regparse.c +5403 -0
- package/deps/jq/modules/oniguruma/src/regparse.h +351 -0
- package/deps/jq/modules/oniguruma/src/regposerr.c +105 -0
- package/deps/jq/modules/oniguruma/src/regposix.c +306 -0
- package/deps/jq/modules/oniguruma/src/regsyntax.c +315 -0
- package/deps/jq/modules/oniguruma/src/regtrav.c +76 -0
- package/deps/jq/modules/oniguruma/src/regversion.c +57 -0
- package/deps/jq/modules/oniguruma/src/sjis.c +341 -0
- package/deps/jq/modules/oniguruma/src/sjis_prop.c +158 -0
- package/deps/jq/modules/oniguruma/src/sjis_prop.gperf +27 -0
- package/deps/jq/modules/oniguruma/src/st.c +589 -0
- package/deps/jq/modules/oniguruma/src/st.h +68 -0
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_fold1_key.c +2250 -0
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_fold2_key.c +203 -0
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_fold3_key.c +113 -0
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_fold_data.c +1225 -0
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_property_data.c +24742 -0
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_property_data_posix.c +4846 -0
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_unfold_key.c +2571 -0
- package/deps/jq/modules/oniguruma/src/unicode.c +664 -0
- package/deps/jq/modules/oniguruma/src/unicode_fold1_key.c +2548 -0
- package/deps/jq/modules/oniguruma/src/unicode_fold2_key.c +203 -0
- package/deps/jq/modules/oniguruma/src/unicode_fold3_key.c +113 -0
- package/deps/jq/modules/oniguruma/src/unicode_fold_data.c +1366 -0
- package/deps/jq/modules/oniguruma/src/unicode_property_data.c +25306 -0
- package/deps/jq/modules/oniguruma/src/unicode_property_data_posix.c +4940 -0
- package/deps/jq/modules/oniguruma/src/unicode_unfold_key.c +2854 -0
- package/deps/jq/modules/oniguruma/src/utf16_be.c +235 -0
- package/deps/jq/modules/oniguruma/src/utf16_le.c +245 -0
- package/deps/jq/modules/oniguruma/src/utf32_be.c +194 -0
- package/deps/jq/modules/oniguruma/src/utf32_le.c +194 -0
- package/deps/jq/modules/oniguruma/src/utf8.c +335 -0
- package/deps/jq/modules/oniguruma/test/Makefile.am +28 -0
- package/deps/jq/modules/oniguruma/test/testc.c +874 -0
- package/deps/jq/modules/oniguruma/test/testu.c +916 -0
- package/deps/jq/modules/oniguruma/test-driver +153 -0
- package/deps/jq/modules/oniguruma/windows/testc.c +869 -0
- package/deps/jq/scripts/crosscompile +2 -1
- package/deps/jq/scripts/gen_utf8_tables.py +2 -3
- package/deps/jq/scripts/update-website +29 -0
- package/deps/jq/scripts/version +7 -2
- package/deps/jq/sig/jq-release.key +41 -0
- package/deps/jq/sig/v1.3/jq-linux-x86.asc +17 -0
- package/deps/jq/sig/v1.3/jq-linux-x86_64.asc +17 -0
- package/deps/jq/sig/v1.3/jq-osx-x86.asc +17 -0
- package/deps/jq/sig/v1.3/jq-osx-x86_64.asc +17 -0
- package/deps/jq/sig/v1.3/jq-win32.exe.asc +17 -0
- package/deps/jq/sig/v1.3/jq-win64.exe.asc +17 -0
- package/deps/jq/sig/v1.3/sha256sum.txt +6 -0
- package/deps/jq/sig/v1.4/jq-linux-x86.asc +17 -0
- package/deps/jq/sig/v1.4/jq-linux-x86_64.asc +17 -0
- package/deps/jq/sig/v1.4/jq-osx-x86.asc +17 -0
- package/deps/jq/sig/v1.4/jq-osx-x86_64.asc +17 -0
- package/deps/jq/sig/v1.4/jq-solaris11-32.asc +17 -0
- package/deps/jq/sig/v1.4/jq-solaris11-64.asc +17 -0
- package/deps/jq/sig/v1.4/jq-win32.exe.asc +17 -0
- package/deps/jq/sig/v1.4/jq-win64.exe.asc +17 -0
- package/deps/jq/sig/v1.4/sha256sum.txt +8 -0
- package/deps/jq/sig/v1.5/jq-linux32-no-oniguruma.asc +17 -0
- package/deps/jq/sig/v1.5/jq-linux32.asc +17 -0
- package/deps/jq/sig/v1.5/jq-linux64.asc +17 -0
- package/deps/jq/sig/v1.5/jq-osx-amd64.asc +17 -0
- package/deps/jq/sig/v1.5/jq-win32.exe.asc +17 -0
- package/deps/jq/sig/v1.5/jq-win64.exe.asc +17 -0
- package/deps/jq/sig/v1.5/sha256sum.txt +5 -0
- package/deps/jq/sig/v1.5rc1/jq-linux-x86_64-static.asc +17 -0
- package/deps/jq/sig/v1.5rc1/jq-win32.exe.asc +17 -0
- package/deps/jq/sig/v1.5rc1/jq-win64.exe.asc +17 -0
- package/deps/jq/sig/v1.5rc1/sha256sum.txt +3 -0
- package/deps/jq/sig/v1.5rc2/jq-linux-x86.asc +17 -0
- package/deps/jq/sig/v1.5rc2/jq-linux-x86_64.asc +17 -0
- package/deps/jq/sig/v1.5rc2/jq-osx-x86_64.asc +17 -0
- package/deps/jq/sig/v1.5rc2/jq-win32.exe.asc +17 -0
- package/deps/jq/sig/v1.5rc2/jq-win64.exe.asc +17 -0
- package/deps/jq/sig/v1.5rc2/sha256sum.txt +5 -0
- package/deps/jq/sig/v1.6/jq-linux32.asc +16 -0
- package/deps/jq/sig/v1.6/jq-linux64.asc +16 -0
- package/deps/jq/sig/v1.6/jq-osx-amd64.asc +16 -0
- package/deps/jq/sig/v1.6/jq-win32.exe.asc +16 -0
- package/deps/jq/sig/v1.6/jq-win64.exe.asc +16 -0
- package/deps/jq/sig/v1.6/sha256sum.txt +5 -0
- package/deps/jq/{builtin.c → src/builtin.c} +449 -344
- package/deps/jq/{builtin.h → src/builtin.h} +0 -0
- package/deps/jq/src/builtin.jq +311 -0
- package/deps/jq/{bytecode.c → src/bytecode.c} +0 -0
- package/deps/jq/{bytecode.h → src/bytecode.h} +0 -0
- package/deps/jq/{compile.c → src/compile.c} +213 -37
- package/deps/jq/{compile.h → src/compile.h} +7 -2
- package/deps/jq/{exec_stack.h → src/exec_stack.h} +0 -0
- package/deps/jq/{execute.c → src/execute.c} +127 -24
- package/deps/jq/{inject_errors.c → src/inject_errors.c} +0 -0
- package/deps/jq/{jq.h → src/jq.h} +13 -2
- package/deps/jq/{jq_parser.h → src/jq_parser.h} +0 -0
- package/deps/jq/{jq_test.c → src/jq_test.c} +1 -1
- package/deps/jq/{jv.c → src/jv.c} +24 -5
- package/deps/jq/{jv.h → src/jv.h} +46 -11
- package/deps/jq/{jv_alloc.c → src/jv_alloc.c} +0 -0
- package/deps/jq/{jv_alloc.h → src/jv_alloc.h} +0 -0
- package/deps/jq/{jv_aux.c → src/jv_aux.c} +38 -14
- package/deps/jq/{jv_dtoa.c → src/jv_dtoa.c} +4 -5
- package/deps/jq/{jv_dtoa.h → src/jv_dtoa.h} +0 -0
- package/deps/jq/src/jv_file.c +81 -0
- package/deps/jq/{jv_parse.c → src/jv_parse.c} +8 -2
- package/deps/jq/{jv_print.c → src/jv_print.c} +80 -27
- package/deps/jq/{jv_unicode.c → src/jv_unicode.c} +28 -4
- package/deps/jq/{jv_unicode.h → src/jv_unicode.h} +1 -0
- package/deps/jq/{jv_utf8_tables.h → src/jv_utf8_tables.h} +0 -0
- package/deps/jq/{lexer.c → src/lexer.c} +317 -292
- package/deps/jq/{lexer.h → src/lexer.h} +16 -12
- package/deps/jq/{lexer.l → src/lexer.l} +5 -4
- package/deps/jq/src/libm.h +291 -0
- package/deps/jq/{linker.c → src/linker.c} +5 -3
- package/deps/jq/{linker.h → src/linker.h} +0 -0
- package/deps/jq/{locfile.c → src/locfile.c} +1 -1
- package/deps/jq/{locfile.h → src/locfile.h} +0 -0
- package/deps/jq/{main.c → src/main.c} +202 -100
- package/deps/jq/{opcode_list.h → src/opcode_list.h} +4 -0
- package/deps/jq/{parser.c → src/parser.c} +1149 -1069
- package/deps/jq/{parser.h → src/parser.h} +28 -24
- package/deps/jq/{parser.y → src/parser.y} +108 -52
- package/deps/jq/{util.c → src/util.c} +12 -9
- package/deps/jq/{util.h → src/util.h} +0 -0
- package/deps/jq/tests/base64.test +35 -0
- package/deps/jq/tests/base64test +5 -0
- package/deps/jq/tests/jq-f-test.sh +4 -0
- package/deps/jq/tests/jq.test +305 -21
- package/deps/jq/tests/jqtest +1 -1
- package/deps/jq/tests/mantest +1 -1
- package/deps/jq/tests/onig.test +13 -0
- package/deps/jq/tests/onigtest +1 -1
- package/deps/jq/tests/optional.test +20 -0
- package/deps/jq/tests/optionaltest +5 -0
- package/deps/jq/tests/setup +7 -1
- package/deps/jq/tests/shtest +133 -29
- package/deps/jq/tests/utf8-truncate.jq +3 -0
- package/deps/jq/tests/utf8test +10 -0
- package/lib/index.js +7 -1
- package/package.json +3 -3
- package/test/santiy.test.js +24 -0
- package/deps/jq/docs/default_manpage.md +0 -22
- package/deps/jq/docs/public/bootstrap/css/bootstrap-responsive.css +0 -1058
- package/deps/jq/docs/public/bootstrap/css/bootstrap-responsive.min.css +0 -9
- package/deps/jq/docs/public/bootstrap/css/bootstrap.css +0 -5224
- package/deps/jq/docs/public/bootstrap/css/bootstrap.min.css +0 -9
- package/deps/jq/docs/public/bootstrap/img/glyphicons-halflings-white.png +0 -0
- package/deps/jq/docs/public/bootstrap/img/glyphicons-halflings.png +0 -0
- package/deps/jq/docs/public/bootstrap/js/bootstrap.js +0 -2027
- package/deps/jq/docs/public/bootstrap/js/bootstrap.min.js +0 -6
- package/deps/jq/docs/templates/shared/_header.liquid +0 -26
- package/deps/jq/jq.1.default +0 -39
- package/deps/jq/jv_file.c +0 -49
- package/deps/jq/libm.h +0 -160
- package/deps/jq/setup.sh +0 -33
- package/reports/jest-port-api.xml +0 -35
package/deps/jq/tests/jq.test
CHANGED
|
@@ -61,7 +61,7 @@ null
|
|
|
61
61
|
null
|
|
62
62
|
"interpolation"
|
|
63
63
|
|
|
64
|
-
@text,@json,([1,.] | (@csv, @tsv)),@html,@uri,@sh,@base64
|
|
64
|
+
@text,@json,([1,.] | (@csv, @tsv)),@html,@uri,@sh,@base64,(@base64 | @base64d)
|
|
65
65
|
"<>&'\"\t"
|
|
66
66
|
"<>&'\"\t"
|
|
67
67
|
"\"<>&'\\\"\\t\""
|
|
@@ -71,12 +71,17 @@ null
|
|
|
71
71
|
"%3C%3E%26'%22%09"
|
|
72
72
|
"'<>&'\\''\"\t'"
|
|
73
73
|
"PD4mJyIJ"
|
|
74
|
+
"<>&'\"\t"
|
|
74
75
|
|
|
75
76
|
# regression test for #436
|
|
76
77
|
@base64
|
|
77
78
|
"foóbar\n"
|
|
78
79
|
"Zm/Ds2Jhcgo="
|
|
79
80
|
|
|
81
|
+
@base64d
|
|
82
|
+
"Zm/Ds2Jhcgo="
|
|
83
|
+
"foóbar\n"
|
|
84
|
+
|
|
80
85
|
@uri
|
|
81
86
|
"\u03bc"
|
|
82
87
|
"%CE%BC"
|
|
@@ -105,6 +110,14 @@ null
|
|
|
105
110
|
{"a":1, "b":2, "c":3, "a$2":4}
|
|
106
111
|
{"a":1, "b":2, "a$2":4}
|
|
107
112
|
|
|
113
|
+
%%FAIL
|
|
114
|
+
{(0):1}
|
|
115
|
+
jq: error: Cannot use number (0) as object key at <top-level>, line 1:
|
|
116
|
+
|
|
117
|
+
%%FAIL
|
|
118
|
+
{non_const:., (0):1}
|
|
119
|
+
jq: error: Cannot use number (0) as object key at <top-level>, line 1:
|
|
120
|
+
|
|
108
121
|
#
|
|
109
122
|
# Field access, piping
|
|
110
123
|
#
|
|
@@ -231,6 +244,10 @@ null
|
|
|
231
244
|
null
|
|
232
245
|
[0,1,2,3,4,5,6,7,8,9]
|
|
233
246
|
|
|
247
|
+
[range(0,1;3,4)]
|
|
248
|
+
null
|
|
249
|
+
[0,1,2, 0,1,2,3, 1,2, 1,2,3]
|
|
250
|
+
|
|
234
251
|
[range(0;10;3)]
|
|
235
252
|
null
|
|
236
253
|
[0,3,6,9]
|
|
@@ -243,6 +260,10 @@ null
|
|
|
243
260
|
null
|
|
244
261
|
[0,-1,-2,-3,-4]
|
|
245
262
|
|
|
263
|
+
[range(0,1;4,5;1,2)]
|
|
264
|
+
null
|
|
265
|
+
[0,1,2,3,0,2, 0,1,2,3,4,0,2,4, 1,2,3,1,3, 1,2,3,4,1,3]
|
|
266
|
+
|
|
246
267
|
[while(.<100; .*2)]
|
|
247
268
|
1
|
|
248
269
|
[1,2,4,8,16,32,64]
|
|
@@ -257,7 +278,7 @@ null
|
|
|
257
278
|
|
|
258
279
|
%%FAIL
|
|
259
280
|
. as $foo | break $foo
|
|
260
|
-
jq: error:
|
|
281
|
+
jq: error: $*label-foo is not defined at <top-level>, line 1:
|
|
261
282
|
|
|
262
283
|
[.[]|[.,1]|until(.[0] < 1; [.[0] - 1, .[1] * .[0]])|.[1]]
|
|
263
284
|
[1,2,3,4,5]
|
|
@@ -287,6 +308,11 @@ null
|
|
|
287
308
|
10
|
|
288
309
|
[0,9,0,5,"nth doesn't support negative indices"]
|
|
289
310
|
|
|
311
|
+
# Check that first(g) does not extract more than one value from g
|
|
312
|
+
first(1,error("foo"))
|
|
313
|
+
null
|
|
314
|
+
1
|
|
315
|
+
|
|
290
316
|
#
|
|
291
317
|
# Check that various builtins evalute all arguments where appropriate,
|
|
292
318
|
# doing cartesian products where appropriate.
|
|
@@ -357,6 +383,15 @@ del(.[2:4],.[0],.[-2:])
|
|
|
357
383
|
[0,1,"a","b",4,5,6,7]
|
|
358
384
|
[0,1,"a","b","c",4,5,6,7]
|
|
359
385
|
|
|
386
|
+
# Slices at large offsets (issue #1108)
|
|
387
|
+
#
|
|
388
|
+
# This is written this way because [range(<large number>)] is
|
|
389
|
+
# significantly slower under valgrind than .[<large number>] = value.
|
|
390
|
+
#
|
|
391
|
+
# We range down rather than up so that we have just one realloc.
|
|
392
|
+
reduce range(65540;65536;-1) as $i ([]; .[$i] = $i)|.[65536:]
|
|
393
|
+
null
|
|
394
|
+
[null,65537,65538,65539,65540]
|
|
360
395
|
|
|
361
396
|
#
|
|
362
397
|
# Variables
|
|
@@ -403,11 +438,11 @@ null
|
|
|
403
438
|
[0]
|
|
404
439
|
[0]
|
|
405
440
|
|
|
406
|
-
%%FAIL
|
|
441
|
+
%%FAIL IGNORE MSG
|
|
407
442
|
. as [] | null
|
|
408
443
|
jq: error: syntax error, unexpected ']', expecting '$' or '[' or '{' (Unix shell quoting issues?) at <top-level>, line 1:
|
|
409
444
|
|
|
410
|
-
%%FAIL
|
|
445
|
+
%%FAIL IGNORE MSG
|
|
411
446
|
. as {} | null
|
|
412
447
|
jq: error: syntax error, unexpected '}' (Unix shell quoting issues?) at <top-level>, line 1:
|
|
413
448
|
|
|
@@ -517,6 +552,15 @@ null
|
|
|
517
552
|
[[], {}, [1,2], {"a":42}, "asdf", "\u03bc"]
|
|
518
553
|
[0, 0, 2, 1, 4, 1]
|
|
519
554
|
|
|
555
|
+
utf8bytelength
|
|
556
|
+
"asdf\u03bc"
|
|
557
|
+
6
|
|
558
|
+
|
|
559
|
+
[.[] | try utf8bytelength catch .]
|
|
560
|
+
[[], {}, [1,2], 55, true, false]
|
|
561
|
+
["array ([]) only strings have UTF-8 byte length","object ({}) only strings have UTF-8 byte length","array ([1,2]) only strings have UTF-8 byte length","number (55) only strings have UTF-8 byte length","boolean (true) only strings have UTF-8 byte length","boolean (false) only strings have UTF-8 byte length"]
|
|
562
|
+
|
|
563
|
+
|
|
520
564
|
map(keys)
|
|
521
565
|
[{}, {"abcd":1,"abc":2,"abcde":3}, {"x":1, "z": 3, "y":2}]
|
|
522
566
|
[[], ["abc","abcd","abcde"], ["x","y","z"]]
|
|
@@ -661,6 +705,128 @@ reduce [[1,2,10], [3,4,10]][] as [$i,$j] (0; . + $i * $j)
|
|
|
661
705
|
null
|
|
662
706
|
14
|
|
663
707
|
|
|
708
|
+
# This, while useless, should still compile.
|
|
709
|
+
reduce . as $n (.; .)
|
|
710
|
+
null
|
|
711
|
+
null
|
|
712
|
+
|
|
713
|
+
# Destructuring
|
|
714
|
+
. as {$a, b: [$c, {$d}]} | [$a, $c, $d]
|
|
715
|
+
{"a":1, "b":[2,{"d":3}]}
|
|
716
|
+
[1,2,3]
|
|
717
|
+
|
|
718
|
+
. as {$a, $b:[$c, $d]}| [$a, $b, $c, $d]
|
|
719
|
+
{"a":1, "b":[2,{"d":3}]}
|
|
720
|
+
[1,[2,{"d":3}],2,{"d":3}]
|
|
721
|
+
|
|
722
|
+
# Destructuring with alternation
|
|
723
|
+
.[] | . as {$a, b: [$c, {$d}]} ?// [$a, {$b}, $e] ?// $f | [$a, $b, $c, $d, $e, $f]
|
|
724
|
+
[{"a":1, "b":[2,{"d":3}]}, [4, {"b":5, "c":6}, 7, 8, 9], "foo"]
|
|
725
|
+
[1, null, 2, 3, null, null]
|
|
726
|
+
[4, 5, null, null, 7, null]
|
|
727
|
+
[null, null, null, null, null, "foo"]
|
|
728
|
+
|
|
729
|
+
# Destructuring DUP/POP issues
|
|
730
|
+
.[] | . as {a:$a} ?// {a:$a} ?// {a:$a} | $a
|
|
731
|
+
[[3],[4],[5],6]
|
|
732
|
+
# Runtime error: "jq: Cannot index array with string \"c\""
|
|
733
|
+
|
|
734
|
+
.[] as {a:$a} ?// {a:$a} ?// {a:$a} | $a
|
|
735
|
+
[[3],[4],[5],6]
|
|
736
|
+
# Runtime error: "jq: Cannot index array with string \"c\""
|
|
737
|
+
|
|
738
|
+
[[3],[4],[5],6][] | . as {a:$a} ?// {a:$a} ?// {a:$a} | $a
|
|
739
|
+
null
|
|
740
|
+
# Runtime error: "jq: Cannot index array with string \"c\""
|
|
741
|
+
|
|
742
|
+
[[3],[4],[5],6] | .[] as {a:$a} ?// {a:$a} ?// {a:$a} | $a
|
|
743
|
+
null
|
|
744
|
+
# Runtime error: "jq: Cannot index array with string \"c\""
|
|
745
|
+
|
|
746
|
+
.[] | . as {a:$a} ?// {a:$a} ?// $a | $a
|
|
747
|
+
[[3],[4],[5],6]
|
|
748
|
+
[3]
|
|
749
|
+
[4]
|
|
750
|
+
[5]
|
|
751
|
+
6
|
|
752
|
+
|
|
753
|
+
.[] as {a:$a} ?// {a:$a} ?// $a | $a
|
|
754
|
+
[[3],[4],[5],6]
|
|
755
|
+
[3]
|
|
756
|
+
[4]
|
|
757
|
+
[5]
|
|
758
|
+
6
|
|
759
|
+
|
|
760
|
+
[[3],[4],[5],6][] | . as {a:$a} ?// {a:$a} ?// $a | $a
|
|
761
|
+
null
|
|
762
|
+
[3]
|
|
763
|
+
[4]
|
|
764
|
+
[5]
|
|
765
|
+
6
|
|
766
|
+
|
|
767
|
+
[[3],[4],[5],6] | .[] as {a:$a} ?// {a:$a} ?// $a | $a
|
|
768
|
+
null
|
|
769
|
+
[3]
|
|
770
|
+
[4]
|
|
771
|
+
[5]
|
|
772
|
+
6
|
|
773
|
+
|
|
774
|
+
.[] | . as {a:$a} ?// $a ?// {a:$a} | $a
|
|
775
|
+
[[3],[4],[5],6]
|
|
776
|
+
[3]
|
|
777
|
+
[4]
|
|
778
|
+
[5]
|
|
779
|
+
6
|
|
780
|
+
|
|
781
|
+
.[] as {a:$a} ?// $a ?// {a:$a} | $a
|
|
782
|
+
[[3],[4],[5],6]
|
|
783
|
+
[3]
|
|
784
|
+
[4]
|
|
785
|
+
[5]
|
|
786
|
+
6
|
|
787
|
+
|
|
788
|
+
[[3],[4],[5],6][] | . as {a:$a} ?// $a ?// {a:$a} | $a
|
|
789
|
+
null
|
|
790
|
+
[3]
|
|
791
|
+
[4]
|
|
792
|
+
[5]
|
|
793
|
+
6
|
|
794
|
+
|
|
795
|
+
[[3],[4],[5],6] | .[] as {a:$a} ?// $a ?// {a:$a} | $a
|
|
796
|
+
null
|
|
797
|
+
[3]
|
|
798
|
+
[4]
|
|
799
|
+
[5]
|
|
800
|
+
6
|
|
801
|
+
|
|
802
|
+
.[] | . as $a ?// {a:$a} ?// {a:$a} | $a
|
|
803
|
+
[[3],[4],[5],6]
|
|
804
|
+
[3]
|
|
805
|
+
[4]
|
|
806
|
+
[5]
|
|
807
|
+
6
|
|
808
|
+
|
|
809
|
+
.[] as $a ?// {a:$a} ?// {a:$a} | $a
|
|
810
|
+
[[3],[4],[5],6]
|
|
811
|
+
[3]
|
|
812
|
+
[4]
|
|
813
|
+
[5]
|
|
814
|
+
6
|
|
815
|
+
|
|
816
|
+
[[3],[4],[5],6][] | . as $a ?// {a:$a} ?// {a:$a} | $a
|
|
817
|
+
null
|
|
818
|
+
[3]
|
|
819
|
+
[4]
|
|
820
|
+
[5]
|
|
821
|
+
6
|
|
822
|
+
|
|
823
|
+
[[3],[4],[5],6] | .[] as $a ?// {a:$a} ?// {a:$a} | $a
|
|
824
|
+
null
|
|
825
|
+
[3]
|
|
826
|
+
[4]
|
|
827
|
+
[5]
|
|
828
|
+
6
|
|
829
|
+
|
|
664
830
|
. as $dot|any($dot[];not)
|
|
665
831
|
[1,2,3,4,true,false,1,2,3,4,5]
|
|
666
832
|
true
|
|
@@ -748,6 +914,10 @@ delpaths([[-200]])
|
|
|
748
914
|
[1,2,3]
|
|
749
915
|
[1,2,3]
|
|
750
916
|
|
|
917
|
+
try delpaths(0) catch .
|
|
918
|
+
{}
|
|
919
|
+
"Paths must be specified as an array"
|
|
920
|
+
|
|
751
921
|
del(.), del(empty), del((.foo,.bar,.baz) | .[2,3,0]), del(.foo[0], .bar[0], .foo, .baz.bar[0].x)
|
|
752
922
|
{"foo": [0,1,2,3,4], "bar": [0,1]}
|
|
753
923
|
null
|
|
@@ -755,6 +925,10 @@ null
|
|
|
755
925
|
{"foo": [1,4], "bar": [1]}
|
|
756
926
|
{"bar": [1]}
|
|
757
927
|
|
|
928
|
+
del(.[1], .[-6], .[2], .[-3:9])
|
|
929
|
+
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
|
930
|
+
[0, 3, 5, 6, 9]
|
|
931
|
+
|
|
758
932
|
#
|
|
759
933
|
# Assignment
|
|
760
934
|
#
|
|
@@ -794,6 +968,18 @@ def inc(x): x |= .+1; inc(.[].a)
|
|
|
794
968
|
[{"a":1,"b":2},{"a":2,"b":4},{"a":7,"b":8}]
|
|
795
969
|
[{"a":2,"b":2},{"a":3,"b":4},{"a":8,"b":8}]
|
|
796
970
|
|
|
971
|
+
# #1358, getpath/1 should work in path expressions
|
|
972
|
+
.[] | try (getpath(["a",0,"b"]) |= 5) catch .
|
|
973
|
+
[null,{"b":0},{"a":0},{"a":null},{"a":[0,1]},{"a":{"b":1}},{"a":[{}]},{"a":[{"c":3}]}]
|
|
974
|
+
{"a":[{"b":5}]}
|
|
975
|
+
{"b":0,"a":[{"b":5}]}
|
|
976
|
+
"Cannot index number with number"
|
|
977
|
+
{"a":[{"b":5}]}
|
|
978
|
+
"Cannot index number with string \"b\""
|
|
979
|
+
"Cannot index object with number"
|
|
980
|
+
{"a":[{"b":5}]}
|
|
981
|
+
{"a":[{"c":3,"b":5}]}
|
|
982
|
+
|
|
797
983
|
.[2][3] = 1
|
|
798
984
|
[4]
|
|
799
985
|
[4, null, [null, null, null, 1]]
|
|
@@ -818,6 +1004,10 @@ try (def x: reverse; x=10) catch .
|
|
|
818
1004
|
[0,1,2]
|
|
819
1005
|
"Invalid path expression with result [2,1,0]"
|
|
820
1006
|
|
|
1007
|
+
.[] = 1
|
|
1008
|
+
[1,null,Infinity,-Infinity,NaN,-NaN]
|
|
1009
|
+
[1,1,1,1,1,1]
|
|
1010
|
+
|
|
821
1011
|
#
|
|
822
1012
|
# Conditionals
|
|
823
1013
|
#
|
|
@@ -830,8 +1020,21 @@ try (def x: reverse; x=10) catch .
|
|
|
830
1020
|
[{"foo":0},{"foo":1},{"foo":[]},{"foo":true},{"foo":false},{"foo":null},{"foo":"foo"},{}]
|
|
831
1021
|
["yep","yep","yep","yep","nope","nope","yep","nope"]
|
|
832
1022
|
|
|
1023
|
+
[if 1,null,2 then 3 else 4 end]
|
|
1024
|
+
null
|
|
1025
|
+
[3,4,3]
|
|
1026
|
+
|
|
1027
|
+
[if empty then 3 else 4 end]
|
|
1028
|
+
null
|
|
1029
|
+
[]
|
|
1030
|
+
|
|
1031
|
+
[if 1 then 3,4 else 5 end]
|
|
1032
|
+
null
|
|
1033
|
+
[3,4]
|
|
833
1034
|
|
|
834
|
-
|
|
1035
|
+
[if null then 3 else 5,6 end]
|
|
1036
|
+
null
|
|
1037
|
+
[5,6]
|
|
835
1038
|
|
|
836
1039
|
[.[] | [.foo[] // .bar]]
|
|
837
1040
|
[{"foo":[1,2], "bar": 42}, {"foo":[1], "bar": null}, {"foo":[null,false,3], "bar": 18}, {"foo":[], "bar":42}, {"foo": [null,false,null], "bar": 41}]
|
|
@@ -1035,12 +1238,8 @@ to_entries
|
|
|
1035
1238
|
[{"key":"a", "value":1}, {"key":"b", "value":2}]
|
|
1036
1239
|
|
|
1037
1240
|
from_entries
|
|
1038
|
-
[{"key":"a", "value":1}, {"Key":"b", "
|
|
1039
|
-
{"a": 1, "b": 2}
|
|
1040
|
-
|
|
1041
|
-
from_entries
|
|
1042
|
-
[{"key":"a", "Value":1}, {"Name":"b", "value":2}]
|
|
1043
|
-
{"a": 1, "b": 2}
|
|
1241
|
+
[{"key":"a", "value":1}, {"Key":"b", "Value":2}, {"name":"c", "value":3}, {"Name":"d", "Value":4}]
|
|
1242
|
+
{"a": 1, "b": 2, "c": 3, "d": 4}
|
|
1044
1243
|
|
|
1045
1244
|
with_entries(.key |= "KEY_" + .)
|
|
1046
1245
|
{"a": 1, "b": 2}
|
|
@@ -1144,15 +1343,13 @@ bsearch(4)
|
|
|
1144
1343
|
[1,2,3]
|
|
1145
1344
|
-4
|
|
1146
1345
|
|
|
1147
|
-
|
|
1148
|
-
"2015-03-05T23:51:47Z"
|
|
1149
|
-
[[2015,2,5,23,51,47,4,63],1425599507]
|
|
1346
|
+
# strptime tests are in optional.test
|
|
1150
1347
|
|
|
1151
1348
|
strftime("%Y-%m-%dT%H:%M:%SZ")
|
|
1152
1349
|
[2015,2,5,23,51,47,4,63]
|
|
1153
1350
|
"2015-03-05T23:51:47Z"
|
|
1154
1351
|
|
|
1155
|
-
strftime("%A, %B %
|
|
1352
|
+
strftime("%A, %B %d, %Y")
|
|
1156
1353
|
1435677542.822351
|
|
1157
1354
|
"Tuesday, June 30, 2015"
|
|
1158
1355
|
|
|
@@ -1173,6 +1370,26 @@ include "c"; [a, c]
|
|
|
1173
1370
|
null
|
|
1174
1371
|
[0,"acmehbah"]
|
|
1175
1372
|
|
|
1373
|
+
%%FAIL
|
|
1374
|
+
module (.+1); 0
|
|
1375
|
+
jq: error: Module metadata must be constant at <top-level>, line 1:
|
|
1376
|
+
|
|
1377
|
+
%%FAIL
|
|
1378
|
+
include "a" (.+1); 0
|
|
1379
|
+
jq: error: Module metadata must be constant at <top-level>, line 1:
|
|
1380
|
+
|
|
1381
|
+
%%FAIL
|
|
1382
|
+
include "a" []; 0
|
|
1383
|
+
jq: error: Module metadata must be an object at <top-level>, line 1:
|
|
1384
|
+
|
|
1385
|
+
%%FAIL
|
|
1386
|
+
include "\ "; 0
|
|
1387
|
+
jq: error: Invalid escape at line 1, column 4 (while parsing '"\ "') at <top-level>, line 1:
|
|
1388
|
+
|
|
1389
|
+
%%FAIL
|
|
1390
|
+
include "\(a)"; 0
|
|
1391
|
+
jq: error: Import path must be constant at <top-level>, line 1:
|
|
1392
|
+
|
|
1176
1393
|
modulemeta
|
|
1177
1394
|
"c"
|
|
1178
1395
|
{"whatever":null,"deps":[{"as":"foo","is_data":false,"relpath":"a"},{"search":"./","as":"d","is_data":false,"relpath":"d"},{"search":"./","as":"d2","is_data":false,"relpath":"d"},{"search":"./../lib/jq","as":"e","is_data":false,"relpath":"e"},{"search":"./../lib/jq","as":"f","is_data":false,"relpath":"f"},{"as":"d","is_data":true,"relpath":"data"}]}
|
|
@@ -1181,7 +1398,7 @@ modulemeta
|
|
|
1181
1398
|
import "syntaxerror" as e; .
|
|
1182
1399
|
jq: error: syntax error, unexpected ';', expecting $end (Unix shell quoting issues?) at /home/nico/ws/jq/tests/modules/syntaxerror/syntaxerror.jq, line 1:
|
|
1183
1400
|
|
|
1184
|
-
%%FAIL
|
|
1401
|
+
%%FAIL IGNORE MSG
|
|
1185
1402
|
%::wat
|
|
1186
1403
|
jq: error: syntax error, unexpected '%', expecting $end (Unix shell quoting issues?) at <top-level>, line 1:
|
|
1187
1404
|
|
|
@@ -1193,13 +1410,29 @@ try -. catch .
|
|
|
1193
1410
|
"very-long-string"
|
|
1194
1411
|
"string (\"very-long-...) cannot be negated"
|
|
1195
1412
|
|
|
1196
|
-
|
|
1197
|
-
["1",2]
|
|
1198
|
-
"
|
|
1413
|
+
join(",")
|
|
1414
|
+
["1",2,true,false,3.4]
|
|
1415
|
+
"1,2,true,false,3.4"
|
|
1416
|
+
|
|
1417
|
+
.[] | join(",")
|
|
1418
|
+
[[], [null], [null,null], [null,null,null]]
|
|
1419
|
+
""
|
|
1420
|
+
""
|
|
1421
|
+
","
|
|
1422
|
+
",,"
|
|
1423
|
+
|
|
1424
|
+
.[] | join(",")
|
|
1425
|
+
[["a",null], [null,"a"]]
|
|
1426
|
+
"a,"
|
|
1427
|
+
",a"
|
|
1199
1428
|
|
|
1200
1429
|
try join(",") catch .
|
|
1201
1430
|
["1","2",{"a":{"b":{"c":33}}}]
|
|
1202
|
-
"string (\",\") and object ({\"a\":{\"b\":{...) cannot be added"
|
|
1431
|
+
"string (\"1,2,\") and object ({\"a\":{\"b\":{...) cannot be added"
|
|
1432
|
+
|
|
1433
|
+
try join(",") catch .
|
|
1434
|
+
["1","2",[3,4,5]]
|
|
1435
|
+
"string (\"1,2,\") and array ([3,4,5]) cannot be added"
|
|
1203
1436
|
|
|
1204
1437
|
{if:0,and:1,or:2,then:3,else:4,elif:5,end:6,as:7,def:8,reduce:9,foreach:10,try:11,catch:12,label:13,import:14,include:15,module:16}
|
|
1205
1438
|
null
|
|
@@ -1225,11 +1458,62 @@ true
|
|
|
1225
1458
|
[range(-99/2;99/2;1)] as $orig | [$orig[]|pow(2;.)|log2] as $back | ($orig|keys)[]|. as $k | (($orig|.[$k])-($back|.[$k]))|if . < 0 then . * -1 else . end|select(.>.00005)
|
|
1226
1459
|
null
|
|
1227
1460
|
|
|
1228
|
-
%%FAIL
|
|
1461
|
+
%%FAIL IGNORE MSG
|
|
1229
1462
|
}
|
|
1230
1463
|
jq: error: syntax error, unexpected INVALID_CHARACTER, expecting $end (Unix shell quoting issues?) at <top-level>, line 1:
|
|
1231
1464
|
|
|
1232
1465
|
(.[{}] = 0)?
|
|
1233
1466
|
null
|
|
1234
1467
|
|
|
1468
|
+
INDEX(range(5)|[., "foo\(.)"]; .[0])
|
|
1469
|
+
null
|
|
1470
|
+
{"0":[0,"foo0"],"1":[1,"foo1"],"2":[2,"foo2"],"3":[3,"foo3"],"4":[4,"foo4"]}
|
|
1471
|
+
|
|
1472
|
+
JOIN({"0":[0,"abc"],"1":[1,"bcd"],"2":[2,"def"],"3":[3,"efg"],"4":[4,"fgh"]}; .[0]|tostring)
|
|
1473
|
+
[[5,"foo"],[3,"bar"],[1,"foobar"]]
|
|
1474
|
+
[[[5,"foo"],null],[[3,"bar"],[3,"efg"]],[[1,"foobar"],[1,"bcd"]]]
|
|
1475
|
+
|
|
1476
|
+
range(5;10)|IN(range(10))
|
|
1477
|
+
null
|
|
1478
|
+
true
|
|
1479
|
+
true
|
|
1480
|
+
true
|
|
1481
|
+
true
|
|
1482
|
+
true
|
|
1483
|
+
|
|
1484
|
+
range(10;12)|IN(range(10))
|
|
1485
|
+
null
|
|
1486
|
+
false
|
|
1487
|
+
false
|
|
1488
|
+
|
|
1489
|
+
IN(range(10;20); range(10))
|
|
1490
|
+
null
|
|
1491
|
+
false
|
|
1492
|
+
|
|
1493
|
+
IN(range(5;20); range(10))
|
|
1494
|
+
null
|
|
1495
|
+
true
|
|
1496
|
+
|
|
1497
|
+
# Regression test for #1347
|
|
1498
|
+
(.a as $x | .b) = "b"
|
|
1499
|
+
{"a":null,"b":null}
|
|
1500
|
+
{"a":null,"b":"b"}
|
|
1501
|
+
|
|
1502
|
+
# Regression test for #1368
|
|
1503
|
+
(.. | select(type == "object" and has("b") and (.b | type) == "array")|.b) |= .[0]
|
|
1504
|
+
{"a": {"b": [1, {"b": 3}]}}
|
|
1505
|
+
{"a": {"b": 1}}
|
|
1506
|
+
|
|
1507
|
+
isempty(empty)
|
|
1508
|
+
null
|
|
1509
|
+
true
|
|
1510
|
+
|
|
1511
|
+
isempty(range(3))
|
|
1512
|
+
null
|
|
1513
|
+
false
|
|
1514
|
+
|
|
1515
|
+
isempty(1,error("foo"))
|
|
1516
|
+
null
|
|
1517
|
+
false
|
|
1518
|
+
|
|
1235
1519
|
|
package/deps/jq/tests/jqtest
CHANGED
package/deps/jq/tests/mantest
CHANGED
package/deps/jq/tests/onig.test
CHANGED
|
@@ -67,6 +67,14 @@ gsub("(?<d>\\d)"; ":\(.d);")
|
|
|
67
67
|
"a1b2"
|
|
68
68
|
"a:1;b:2;"
|
|
69
69
|
|
|
70
|
+
gsub("a";"b")
|
|
71
|
+
"aaaaa"
|
|
72
|
+
"bbbbb"
|
|
73
|
+
|
|
74
|
+
gsub( "(.*)"; ""; "x")
|
|
75
|
+
""
|
|
76
|
+
""
|
|
77
|
+
|
|
70
78
|
[.[] | scan(", ")]
|
|
71
79
|
["a,b, c, d, e,f",", a,b, c, d, e,f, "]
|
|
72
80
|
[", ",", ",", ",", ",", ",", ",", ",", "]
|
|
@@ -83,3 +91,8 @@ gsub("(?<d>\\d)"; ":\(.d);")
|
|
|
83
91
|
gsub("(?<x>.)[^a]*"; "+\(.x)-")
|
|
84
92
|
"Abcabc"
|
|
85
93
|
"+A-+a-"
|
|
94
|
+
|
|
95
|
+
# utf-8
|
|
96
|
+
sub("(?<x>.)"; "\(.x)!")
|
|
97
|
+
"’"
|
|
98
|
+
"’!"
|
package/deps/jq/tests/onigtest
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# See tests/jq.test and the jq manual for more information.
|
|
2
|
+
|
|
3
|
+
# strptime() is not available on mingw/WIN32
|
|
4
|
+
[strptime("%Y-%m-%dT%H:%M:%SZ")|(.,mktime)]
|
|
5
|
+
"2015-03-05T23:51:47Z"
|
|
6
|
+
[[2015,2,5,23,51,47,4,63],1425599507]
|
|
7
|
+
|
|
8
|
+
# Check day-of-week and day of year computations
|
|
9
|
+
# (should trip an assert if this fails)
|
|
10
|
+
# This date range
|
|
11
|
+
last(range(365 * 67)|("1970-03-01T01:02:03Z"|strptime("%Y-%m-%dT%H:%M:%SZ")|mktime) + (86400 * .)|strftime("%Y-%m-%dT%H:%M:%SZ")|strptime("%Y-%m-%dT%H:%M:%SZ"))
|
|
12
|
+
null
|
|
13
|
+
[2037,1,11,1,2,3,3,41]
|
|
14
|
+
|
|
15
|
+
# %e is not available on mingw/WIN32
|
|
16
|
+
strftime("%A, %B %e, %Y")
|
|
17
|
+
1435677542.822351
|
|
18
|
+
"Tuesday, June 30, 2015"
|
|
19
|
+
|
|
20
|
+
|
package/deps/jq/tests/setup
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
# This is meant to be included by each test's shell script driver.
|
|
4
4
|
|
|
5
|
+
if [ -n "$TRACE_TESTS" ]; then
|
|
6
|
+
set -x
|
|
7
|
+
fi
|
|
8
|
+
|
|
5
9
|
set -eu
|
|
6
10
|
|
|
7
11
|
JQTESTDIR=$(cd "$(dirname "$0")" && pwd)
|
|
@@ -11,9 +15,11 @@ JQ=$JQBASEDIR/jq
|
|
|
11
15
|
if [ -z "${NO_VALGRIND-}" ] && which valgrind > /dev/null; then
|
|
12
16
|
VALGRIND="valgrind --error-exitcode=1 --leak-check=full \
|
|
13
17
|
--suppressions=$JQTESTDIR/onig.supp"
|
|
18
|
+
VG_EXIT0=--error-exitcode=0
|
|
14
19
|
Q=-q
|
|
15
20
|
else
|
|
16
21
|
VALGRIND=
|
|
22
|
+
VG_EXIT0=
|
|
17
23
|
Q=
|
|
18
24
|
fi
|
|
19
25
|
|
|
@@ -29,7 +35,7 @@ clean () {
|
|
|
29
35
|
fi
|
|
30
36
|
}
|
|
31
37
|
trap clean EXIT
|
|
32
|
-
d
|
|
38
|
+
d=$(mktemp -d -t jqXXXXXX || true)
|
|
33
39
|
if [ -z "$d" ]; then
|
|
34
40
|
echo "Your OS does not support mktemp(1) -d" 1>&2
|
|
35
41
|
exit 1
|