@port-labs/jq-node-bindings 0.0.14 → 0.0.15-dev2
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/README.md +6 -1
- package/binding.gyp +42 -20
- package/configure +1 -1
- package/deps/jq/.gitattributes +12 -0
- package/deps/jq/AUTHORS +149 -43
- package/deps/jq/COPYING +75 -1
- package/deps/jq/ChangeLog +2 -2
- package/deps/jq/Makefile.am +106 -65
- package/deps/jq/NEWS.md +391 -0
- package/deps/jq/README.md +54 -52
- package/deps/jq/SECURITY.md +7 -0
- package/deps/jq/compile-ios.sh +106 -102
- package/deps/jq/configure.ac +72 -59
- package/deps/jq/docs/Pipfile +14 -0
- package/deps/jq/docs/Pipfile.lock +415 -0
- package/deps/jq/docs/README.md +15 -14
- package/deps/jq/docs/build_manpage.py +251 -0
- package/deps/jq/docs/build_mantests.py +21 -0
- package/deps/jq/docs/build_website.py +95 -0
- package/deps/jq/docs/content/download/default.yml +249 -0
- package/deps/jq/docs/content/index.yml +83 -0
- package/deps/jq/docs/content/{3.manual/v1.6 → manual/dev}/manual.yml +992 -452
- package/deps/jq/docs/content/{3.manual → manual}/v1.3/manual.yml +105 -116
- package/deps/jq/docs/content/{3.manual → manual}/v1.4/manual.yml +122 -129
- package/deps/jq/docs/content/{3.manual → manual}/v1.5/manual.yml +313 -262
- package/deps/jq/docs/content/{3.manual → manual/v1.6}/manual.yml +407 -332
- package/deps/jq/docs/content/manual/v1.7/manual.yml +3697 -0
- package/deps/jq/docs/content/tutorial/default.yml +337 -0
- package/deps/jq/docs/manual_schema.yml +60 -0
- package/deps/jq/docs/public/css/style.css +99 -0
- package/deps/jq/docs/public/icon.png +0 -0
- package/deps/jq/docs/public/icon.svg +1 -0
- package/deps/jq/docs/public/jq.svg +1 -0
- package/deps/jq/docs/public/js/manual-search.js +31 -49
- package/deps/jq/docs/templates/default.html.j2 +31 -0
- package/deps/jq/docs/templates/index.html.j2 +58 -0
- package/deps/jq/docs/templates/manual.html.j2 +120 -0
- package/deps/jq/docs/templates/shared/_footer.html.j2 +14 -0
- package/deps/jq/docs/templates/shared/_head.html.j2 +23 -0
- package/deps/jq/docs/templates/shared/_navbar.html.j2 +40 -0
- package/deps/jq/docs/validate_manual_schema.py +19 -0
- package/deps/jq/jq.1.prebuilt +1102 -294
- package/deps/jq/jq.spec +2 -3
- package/deps/jq/libjq.pc.in +11 -0
- package/deps/jq/m4/ax_pthread.m4 +522 -0
- package/deps/jq/modules/oniguruma/.travis.yml +17 -0
- package/deps/jq/modules/oniguruma/CMakeLists.txt +206 -41
- package/deps/jq/modules/oniguruma/COPYING +23 -25
- package/deps/jq/modules/oniguruma/HISTORY +368 -23
- package/deps/jq/modules/oniguruma/Makefile.am +61 -7
- package/deps/jq/modules/oniguruma/README +34 -20
- package/deps/jq/modules/oniguruma/README.md +106 -33
- package/deps/jq/modules/oniguruma/README_japanese +183 -0
- package/deps/jq/modules/oniguruma/autogen.sh +9 -0
- package/deps/jq/modules/oniguruma/cmake/Config.cmake.in +4 -0
- package/deps/jq/modules/oniguruma/configure.ac +66 -55
- package/deps/jq/modules/oniguruma/doc/API +485 -42
- package/deps/jq/modules/oniguruma/doc/API.ja +732 -293
- package/deps/jq/modules/oniguruma/doc/CALLOUTS.API +397 -0
- package/deps/jq/modules/oniguruma/doc/CALLOUTS.API.ja +393 -0
- package/deps/jq/modules/oniguruma/doc/CALLOUTS.BUILTIN +95 -0
- package/deps/jq/modules/oniguruma/doc/CALLOUTS.BUILTIN.ja +93 -0
- package/deps/jq/modules/oniguruma/doc/FAQ +3 -3
- package/deps/jq/modules/oniguruma/doc/FAQ.ja +8 -8
- package/deps/jq/modules/oniguruma/doc/RE +223 -63
- package/deps/jq/modules/oniguruma/doc/RE.ja +420 -265
- package/deps/jq/modules/oniguruma/doc/SYNTAX.md +1091 -0
- package/deps/jq/modules/oniguruma/doc/UNICODE_PROPERTIES +840 -697
- package/deps/jq/modules/oniguruma/harnesses/ascii_compatible.dict +113 -0
- package/deps/jq/modules/oniguruma/harnesses/base.c +749 -0
- package/deps/jq/modules/oniguruma/harnesses/deluxe.c +206 -0
- package/deps/jq/modules/oniguruma/harnesses/dict_conv.py +72 -0
- package/deps/jq/modules/oniguruma/harnesses/fuzzer.options +2 -0
- package/deps/jq/modules/oniguruma/harnesses/libfuzzer-onig.cpp +45 -0
- package/deps/jq/modules/oniguruma/harnesses/regset.c +392 -0
- package/deps/jq/modules/oniguruma/index.html +16 -5
- package/deps/jq/modules/oniguruma/index_ja.html +16 -5
- package/deps/jq/modules/oniguruma/make_win.bat +5 -0
- package/deps/jq/modules/oniguruma/make_win32.bat +5 -3
- package/deps/jq/modules/oniguruma/make_win64.bat +5 -3
- package/deps/jq/modules/oniguruma/onig-config.cmake.in +80 -0
- package/deps/jq/modules/oniguruma/onig-config.in +1 -1
- package/deps/jq/modules/oniguruma/oniguruma.pc.cmake.in +1 -1
- package/deps/jq/modules/oniguruma/oniguruma.pc.in +0 -1
- package/deps/jq/modules/oniguruma/sample/CMakeLists.txt +9 -2
- package/deps/jq/modules/oniguruma/sample/Makefile.am +24 -5
- package/deps/jq/modules/oniguruma/sample/bug_fix.c +13 -51
- package/deps/jq/modules/oniguruma/sample/callback_each_match.c +168 -0
- package/deps/jq/modules/oniguruma/sample/callout.c +268 -0
- package/deps/jq/modules/oniguruma/sample/count.c +125 -0
- package/deps/jq/modules/oniguruma/sample/crnl.c +6 -4
- package/deps/jq/modules/oniguruma/sample/echo.c +136 -0
- package/deps/jq/modules/oniguruma/sample/encode.c +53 -146
- package/deps/jq/modules/oniguruma/sample/listcap.c +18 -10
- package/deps/jq/modules/oniguruma/sample/names.c +10 -6
- package/deps/jq/modules/oniguruma/sample/posix.c +13 -2
- package/deps/jq/modules/oniguruma/sample/regset.c +95 -0
- package/deps/jq/modules/oniguruma/sample/scan.c +20 -6
- package/deps/jq/modules/oniguruma/sample/simple.c +8 -4
- package/deps/jq/modules/oniguruma/sample/sql.c +13 -8
- package/deps/jq/modules/oniguruma/sample/syntax.c +11 -10
- package/deps/jq/modules/oniguruma/sample/user_property.c +12 -7
- package/deps/jq/modules/oniguruma/src/Makefile.am +41 -15
- package/deps/jq/modules/oniguruma/src/Makefile.windows +196 -183
- package/deps/jq/modules/oniguruma/src/ascii.c +64 -7
- package/deps/jq/modules/oniguruma/src/big5.c +25 -15
- package/deps/jq/modules/oniguruma/src/config.h.cmake.in +7 -22
- package/deps/jq/modules/oniguruma/src/config.h.win32 +56 -84
- package/deps/jq/modules/oniguruma/src/config.h.win64 +56 -84
- package/deps/jq/modules/oniguruma/src/config.h.windows.in +62 -0
- package/deps/jq/modules/oniguruma/src/cp1251.c +14 -8
- package/deps/jq/modules/oniguruma/src/euc_jp.c +28 -30
- package/deps/jq/modules/oniguruma/src/euc_jp_prop.c +25 -32
- package/deps/jq/modules/oniguruma/src/euc_jp_prop.gperf +1 -2
- package/deps/jq/modules/oniguruma/src/euc_kr.c +27 -15
- package/deps/jq/modules/oniguruma/src/euc_tw.c +40 -17
- package/deps/jq/modules/oniguruma/src/gb18030.c +177 -119
- package/deps/jq/modules/oniguruma/src/gperf_fold_key_conv.py +12 -8
- package/deps/jq/modules/oniguruma/src/gperf_unfold_key_conv.py +8 -6
- package/deps/jq/modules/oniguruma/src/iso8859_1.c +92 -91
- package/deps/jq/modules/oniguruma/src/iso8859_10.c +13 -29
- package/deps/jq/modules/oniguruma/src/iso8859_11.c +4 -2
- package/deps/jq/modules/oniguruma/src/iso8859_13.c +13 -33
- package/deps/jq/modules/oniguruma/src/iso8859_14.c +13 -30
- package/deps/jq/modules/oniguruma/src/iso8859_15.c +13 -34
- package/deps/jq/modules/oniguruma/src/iso8859_16.c +13 -29
- package/deps/jq/modules/oniguruma/src/iso8859_2.c +13 -29
- package/deps/jq/modules/oniguruma/src/iso8859_3.c +13 -33
- package/deps/jq/modules/oniguruma/src/iso8859_4.c +13 -32
- package/deps/jq/modules/oniguruma/src/iso8859_5.c +16 -23
- package/deps/jq/modules/oniguruma/src/iso8859_6.c +4 -2
- package/deps/jq/modules/oniguruma/src/iso8859_7.c +14 -29
- package/deps/jq/modules/oniguruma/src/iso8859_8.c +4 -2
- package/deps/jq/modules/oniguruma/src/iso8859_9.c +13 -33
- package/deps/jq/modules/oniguruma/src/koi8.c +14 -27
- package/deps/jq/modules/oniguruma/src/koi8_r.c +12 -19
- package/deps/jq/modules/oniguruma/src/make_property.sh +21 -0
- package/deps/jq/modules/oniguruma/src/make_unicode_egcb.sh +7 -0
- package/deps/jq/modules/oniguruma/src/make_unicode_egcb_data.py +267 -0
- package/deps/jq/modules/oniguruma/src/make_unicode_fold.sh +25 -11
- package/deps/jq/modules/oniguruma/src/make_unicode_fold_data.py +206 -26
- package/deps/jq/modules/oniguruma/src/make_unicode_property.sh +19 -10
- package/deps/jq/modules/oniguruma/src/make_unicode_property_data.py +474 -375
- package/deps/jq/modules/oniguruma/src/make_unicode_wb.sh +7 -0
- package/deps/jq/modules/oniguruma/src/make_unicode_wb_data.py +267 -0
- package/deps/jq/modules/oniguruma/src/mktable.c +28 -24
- package/deps/jq/modules/oniguruma/src/onig_init.c +2 -2
- package/deps/jq/modules/oniguruma/src/oniggnu.h +7 -5
- package/deps/jq/modules/oniguruma/src/onigposix.h +40 -16
- package/deps/jq/modules/oniguruma/src/oniguruma.h +357 -107
- package/deps/jq/modules/oniguruma/src/regcomp.c +6214 -3933
- package/deps/jq/modules/oniguruma/src/regenc.c +197 -120
- package/deps/jq/modules/oniguruma/src/regenc.h +106 -63
- package/deps/jq/modules/oniguruma/src/regerror.c +112 -91
- package/deps/jq/modules/oniguruma/src/regexec.c +4876 -2010
- package/deps/jq/modules/oniguruma/src/regext.c +8 -8
- package/deps/jq/modules/oniguruma/src/reggnu.c +13 -17
- package/deps/jq/modules/oniguruma/src/regint.h +757 -491
- package/deps/jq/modules/oniguruma/src/regparse.c +7204 -3240
- package/deps/jq/modules/oniguruma/src/regparse.h +361 -218
- package/deps/jq/modules/oniguruma/src/regposerr.c +49 -9
- package/deps/jq/modules/oniguruma/src/regposix.c +106 -24
- package/deps/jq/modules/oniguruma/src/regsyntax.c +66 -13
- package/deps/jq/modules/oniguruma/src/regtrav.c +1 -1
- package/deps/jq/modules/oniguruma/src/regversion.c +6 -4
- package/deps/jq/modules/oniguruma/src/sjis.c +23 -52
- package/deps/jq/modules/oniguruma/src/sjis_prop.c +25 -32
- package/deps/jq/modules/oniguruma/src/sjis_prop.gperf +1 -2
- package/deps/jq/modules/oniguruma/src/st.c +248 -249
- package/deps/jq/modules/oniguruma/src/st.h +4 -5
- package/deps/jq/modules/oniguruma/src/unicode.c +869 -294
- package/deps/jq/modules/oniguruma/src/unicode_egcb_data.c +1419 -0
- package/deps/jq/modules/oniguruma/src/unicode_fold1_key.c +1829 -1300
- package/deps/jq/modules/oniguruma/src/unicode_fold2_key.c +32 -9
- package/deps/jq/modules/oniguruma/src/unicode_fold3_key.c +32 -9
- package/deps/jq/modules/oniguruma/src/unicode_fold_data.c +1210 -984
- package/deps/jq/modules/oniguruma/src/unicode_property_data.c +22480 -15198
- package/deps/jq/modules/oniguruma/src/unicode_property_data_posix.c +1463 -591
- package/deps/jq/modules/oniguruma/src/unicode_unfold_key.c +1958 -1418
- package/deps/jq/modules/oniguruma/src/unicode_wb_data.c +1106 -0
- package/deps/jq/modules/oniguruma/src/utf16_be.c +90 -49
- package/deps/jq/modules/oniguruma/src/utf16_le.c +80 -49
- package/deps/jq/modules/oniguruma/src/utf32_be.c +14 -42
- package/deps/jq/modules/oniguruma/src/utf32_le.c +13 -40
- package/deps/jq/modules/oniguruma/src/utf8.c +33 -78
- package/deps/jq/modules/oniguruma/test/CMakeLists.txt +55 -0
- package/deps/jq/modules/oniguruma/test/Makefile.am +65 -10
- package/deps/jq/modules/oniguruma/test/test.sh +17 -0
- package/deps/jq/modules/oniguruma/test/test_back.c +1450 -0
- package/deps/jq/modules/oniguruma/test/test_options.c +228 -0
- package/deps/jq/modules/oniguruma/test/test_regset.c +466 -0
- package/deps/jq/modules/oniguruma/test/test_syntax.c +365 -0
- package/deps/jq/modules/oniguruma/test/test_utf8.c +1761 -0
- package/deps/jq/modules/oniguruma/test/testc.c +128 -88
- package/deps/jq/modules/oniguruma/test/testp.c +613 -0
- package/deps/jq/modules/oniguruma/test/testu.c +75 -28
- package/deps/jq/modules/oniguruma/tis-ci/stub.c +3 -0
- package/deps/jq/modules/oniguruma/tis-ci/test_back.config +26 -0
- package/deps/jq/modules/oniguruma/tis-ci/test_regset.config +20 -0
- package/deps/jq/modules/oniguruma/tis-ci/test_syntax.config +26 -0
- package/deps/jq/modules/oniguruma/tis-ci/test_utf8.config +25 -0
- package/deps/jq/modules/oniguruma/tis-ci/testc.config +26 -0
- package/deps/jq/modules/oniguruma/tis-ci/testu.config +24 -0
- package/deps/jq/modules/oniguruma/tis.config +1336 -0
- package/deps/jq/modules/oniguruma/windows/CMakeLists.txt +8 -0
- package/deps/jq/modules/oniguruma/windows/testc.c +865 -869
- package/deps/jq/scripts/update-website +6 -5
- package/deps/jq/scripts/version +10 -7
- package/deps/jq/sig/jq-release-new.key +29 -0
- package/deps/jq/sig/v1.4/sha256sum.txt +1 -0
- package/deps/jq/sig/v1.5/sha256sum.txt +2 -0
- package/deps/jq/sig/v1.5rc1/sha256sum.txt +1 -0
- package/deps/jq/sig/v1.5rc2/sha256sum.txt +2 -0
- package/deps/jq/sig/v1.6/sha256sum.txt +2 -0
- package/deps/jq/sig/v1.7/jq-1.7.tar.gz.asc +16 -0
- package/deps/jq/sig/v1.7/jq-1.7.zip.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-amd64.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-arm64.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-armel.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-armhf.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-i386.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mips.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mips64.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mips64el.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mips64r6.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mips64r6el.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mipsel.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mipsr6.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mipsr6el.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-powerpc.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-ppc64el.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-riscv64.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-s390x.asc +16 -0
- package/deps/jq/sig/v1.7/jq-macos-amd64.asc +16 -0
- package/deps/jq/sig/v1.7/jq-macos-arm64.asc +16 -0
- package/deps/jq/sig/v1.7/jq-windows-amd64.exe.asc +16 -0
- package/deps/jq/sig/v1.7/jq-windows-i386.exe.asc +16 -0
- package/deps/jq/sig/v1.7/sha256sum.txt +23 -0
- package/deps/jq/sig/v1.7.1/jq-1.7.1.tar.gz.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-1.7.1.zip.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-amd64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-arm64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-armel.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-armhf.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-i386.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mips.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mips64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mips64el.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mips64r6.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mips64r6el.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mipsel.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mipsr6.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mipsr6el.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-powerpc.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-ppc64el.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-riscv64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-s390x.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-macos-amd64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-macos-arm64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-osx-amd64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-win64.exe.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-windows-amd64.exe.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-windows-i386.exe.asc +16 -0
- package/deps/jq/sig/v1.7.1/sha256sum.txt +26 -0
- package/deps/jq/sig/v1.7rc1/jq-1.7rc1.tar.gz.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-1.7rc1.zip.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-amd64.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-arm64.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-armel.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-armhf.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-i386.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mips.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mips64.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mips64el.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mips64r6.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mips64r6el.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mipsel.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mipsr6.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mipsr6el.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-powerpc.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-ppc64el.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-riscv64.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-s390x.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-macos-amd64.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-macos-arm64.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-windows-amd64.exe.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-windows-i386.exe.asc +16 -0
- package/deps/jq/sig/v1.7rc1/sha256sum.txt +23 -0
- package/deps/jq/sig/v1.7rc2/jq-1.7rc2.tar.gz.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-1.7rc2.zip.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-amd64.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-arm64.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-armel.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-armhf.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-i386.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mips.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mips64.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mips64el.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mips64r6.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mips64r6el.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mipsel.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mipsr6.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mipsr6el.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-powerpc.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-ppc64el.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-riscv64.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-s390x.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-macos-amd64.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-macos-arm64.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-windows-amd64.exe.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-windows-i386.exe.asc +16 -0
- package/deps/jq/sig/v1.7rc2/sha256sum.txt +23 -0
- package/deps/jq/src/builtin.c +537 -343
- package/deps/jq/src/builtin.h +18 -0
- package/deps/jq/src/builtin.jq +116 -143
- package/deps/jq/src/bytecode.h +8 -4
- package/deps/jq/src/compile.c +157 -143
- package/deps/jq/src/compile.h +3 -4
- package/deps/jq/src/decNumber/ICU-license.html +45 -0
- package/deps/jq/src/decNumber/decBasic.c +3908 -0
- package/deps/jq/src/decNumber/decCommon.c +1835 -0
- package/deps/jq/src/decNumber/decContext.c +437 -0
- package/deps/jq/src/decNumber/decContext.h +254 -0
- package/deps/jq/src/decNumber/decDPD.h +1185 -0
- package/deps/jq/src/decNumber/decDouble.c +140 -0
- package/deps/jq/src/decNumber/decDouble.h +155 -0
- package/deps/jq/src/decNumber/decNumber.c +8143 -0
- package/deps/jq/src/decNumber/decNumber.h +182 -0
- package/deps/jq/src/decNumber/decNumberLocal.h +757 -0
- package/deps/jq/src/decNumber/decPacked.c +220 -0
- package/deps/jq/src/decNumber/decPacked.h +52 -0
- package/deps/jq/src/decNumber/decQuad.c +135 -0
- package/deps/jq/src/decNumber/decQuad.h +177 -0
- package/deps/jq/src/decNumber/decSingle.c +71 -0
- package/deps/jq/src/decNumber/decSingle.h +86 -0
- package/deps/jq/src/decNumber/decimal128.c +553 -0
- package/deps/jq/src/decNumber/decimal128.h +81 -0
- package/deps/jq/src/decNumber/decimal32.c +476 -0
- package/deps/jq/src/decNumber/decimal32.h +81 -0
- package/deps/jq/src/decNumber/decimal64.c +839 -0
- package/deps/jq/src/decNumber/decimal64.h +83 -0
- package/deps/jq/src/decNumber/decnumber.pdf +0 -0
- package/deps/jq/src/decNumber/example1.c +38 -0
- package/deps/jq/src/decNumber/example2.c +52 -0
- package/deps/jq/src/decNumber/example3.c +64 -0
- package/deps/jq/src/decNumber/example4.c +61 -0
- package/deps/jq/src/decNumber/example5.c +36 -0
- package/deps/jq/src/decNumber/example6.c +61 -0
- package/deps/jq/src/decNumber/example7.c +35 -0
- package/deps/jq/src/decNumber/example8.c +39 -0
- package/deps/jq/src/decNumber/readme.txt +81 -0
- package/deps/jq/src/exec_stack.h +5 -3
- package/deps/jq/src/execute.c +126 -44
- package/deps/jq/src/inject_errors.c +0 -2
- package/deps/jq/src/jq.h +10 -1
- package/deps/jq/src/jq_test.c +222 -11
- package/deps/jq/src/jv.c +807 -176
- package/deps/jq/src/jv.h +22 -1
- package/deps/jq/src/jv_alloc.c +33 -26
- package/deps/jq/src/jv_alloc.h +0 -11
- package/deps/jq/src/jv_aux.c +153 -67
- package/deps/jq/src/jv_dtoa.c +12 -2
- package/deps/jq/src/jv_dtoa_tsd.c +51 -0
- package/deps/jq/src/jv_dtoa_tsd.h +4 -0
- package/deps/jq/src/jv_parse.c +70 -15
- package/deps/jq/src/jv_print.c +56 -60
- package/deps/jq/src/jv_private.h +7 -0
- package/deps/jq/src/jv_thread.h +76 -0
- package/deps/jq/src/jv_unicode.c +18 -0
- package/deps/jq/src/jv_unicode.h +2 -0
- package/deps/jq/src/lexer.c +782 -543
- package/deps/jq/src/lexer.h +438 -64
- package/deps/jq/src/lexer.l +10 -3
- package/deps/jq/src/libm.h +16 -6
- package/deps/jq/src/linker.c +97 -40
- package/deps/jq/src/locfile.c +2 -1
- package/deps/jq/src/main.c +384 -336
- package/deps/jq/src/opcode_list.h +5 -2
- package/deps/jq/src/parser.c +2260 -1898
- package/deps/jq/src/parser.h +115 -98
- package/deps/jq/src/parser.y +124 -89
- package/deps/jq/src/util.c +854 -55
- package/deps/jq/src/util.h +6 -4
- package/deps/jq/tests/jq.test +762 -26
- package/deps/jq/tests/jq_fuzz_compile.c +27 -0
- package/deps/jq/tests/jq_fuzz_execute.cpp +42 -0
- package/deps/jq/tests/jq_fuzz_fixed.cpp +297 -0
- package/deps/jq/tests/jq_fuzz_load_file.c +28 -0
- package/deps/jq/tests/jq_fuzz_parse.c +21 -0
- package/deps/jq/tests/jq_fuzz_parse_extended.c +36 -0
- package/deps/jq/tests/jq_fuzz_parse_stream.c +21 -0
- package/deps/jq/tests/local.supp +14 -0
- package/deps/jq/tests/man.test +979 -0
- package/deps/jq/tests/manonig.test +76 -0
- package/deps/jq/tests/manonigtest +5 -0
- package/deps/jq/tests/mantest +1 -2
- package/deps/jq/tests/modules/home2/.jq/g.jq +1 -0
- package/deps/jq/tests/modules/shadow1.jq +2 -0
- package/deps/jq/tests/modules/shadow2.jq +1 -0
- package/deps/jq/tests/modules/test_bind_order0.jq +1 -0
- package/deps/jq/tests/modules/test_bind_order1.jq +1 -1
- package/deps/jq/tests/modules/test_bind_order2.jq +0 -1
- package/deps/jq/tests/no-main-program.jq +1 -0
- package/deps/jq/tests/onig.test +77 -2
- package/deps/jq/tests/setup +7 -2
- package/deps/jq/tests/shtest +478 -59
- package/deps/jq/tests/uri.test +38 -0
- package/deps/jq/tests/uritest +5 -0
- package/deps/jq/tests/yes-main-program.jq +2 -0
- package/index.d.ts +2 -0
- package/lib/index.js +3 -0
- package/lib/jq.js +15 -1
- package/lib/templateAsync.js +137 -0
- package/package.json +3 -3
- package/src/binding.cc +623 -146
- package/src/binding.h +3 -4
- package/test/santiy-async.test.js +171 -0
- package/test/santiy.test.js +2 -2
- package/test/template-async.test.js +182 -0
- package/test/template.test.js +3 -3
- package/deps/jq/.travis.yml +0 -202
- package/deps/jq/NEWS +0 -89
- package/deps/jq/appveyor.yml +0 -53
- package/deps/jq/docs/Gemfile +0 -7
- package/deps/jq/docs/Gemfile.lock +0 -63
- package/deps/jq/docs/Rakefile +0 -24
- package/deps/jq/docs/Rakefile.manual +0 -49
- package/deps/jq/docs/Rakefile.website +0 -76
- package/deps/jq/docs/content/1.tutorial/default.yml +0 -327
- package/deps/jq/docs/content/2.download/default.yml +0 -193
- package/deps/jq/docs/content/index/index.yml +0 -73
- package/deps/jq/docs/public/css/base.scss +0 -181
- package/deps/jq/docs/public/jq.png +0 -0
- package/deps/jq/docs/site.yml +0 -9
- package/deps/jq/docs/templates/default.liquid +0 -34
- package/deps/jq/docs/templates/index.liquid +0 -73
- package/deps/jq/docs/templates/manual.liquid +0 -99
- package/deps/jq/docs/templates/shared/_footer.liquid +0 -10
- package/deps/jq/docs/templates/shared/_head.liquid +0 -17
- package/deps/jq/docs/templates/shared/_navbar.liquid +0 -27
- package/deps/jq/modules/oniguruma/README.ja +0 -195
- package/deps/jq/modules/oniguruma/cmake/dist.cmake +0 -321
- package/deps/jq/modules/oniguruma/contributed/libfuzzer-onig.cpp +0 -31
- package/deps/jq/modules/oniguruma/dist.info +0 -10
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_fold1_key.c +0 -2250
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_fold2_key.c +0 -203
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_fold3_key.c +0 -113
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_fold_data.c +0 -1225
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_property_data.c +0 -24742
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_property_data_posix.c +0 -4846
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_unfold_key.c +0 -2571
- /package/deps/jq/sig/{jq-release.key → jq-release-old.key} +0 -0
- /package/deps/jq/tests/modules/{.jq → home1/.jq} +0 -0
package/deps/jq/tests/shtest
CHANGED
|
@@ -1,9 +1,22 @@
|
|
|
1
|
-
#!/bin/sh
|
|
1
|
+
#!/bin/sh -x
|
|
2
2
|
|
|
3
3
|
. "${0%/*}/setup" "$@"
|
|
4
4
|
|
|
5
|
+
msys=false
|
|
6
|
+
mingw=false
|
|
7
|
+
case "$(uname -s)" in
|
|
8
|
+
MSYS*) msys=true;;
|
|
9
|
+
MINGW*) mingw=true;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
JQ_NO_B=$JQ
|
|
13
|
+
JQ="$JQ -b"
|
|
14
|
+
|
|
5
15
|
PATH=$JQBASEDIR:$PATH $JQBASEDIR/tests/jq-f-test.sh > /dev/null
|
|
6
16
|
|
|
17
|
+
SHELL=/bin/sh
|
|
18
|
+
export SHELL
|
|
19
|
+
|
|
7
20
|
if [ -f "$JQBASEDIR/.libs/libinject_errors.so" ]; then
|
|
8
21
|
# Do some simple error injection tests to check that we're handling
|
|
9
22
|
# I/O errors correctly.
|
|
@@ -30,63 +43,83 @@ $VALGRIND $Q $JQ -Rne '[inputs] == ["a\u0000b", "c\u0000d", "e"]' $d/input
|
|
|
30
43
|
|
|
31
44
|
# String constant folding (addition only)
|
|
32
45
|
nref=$($VALGRIND $Q $JQ -n --debug-dump-disasm '"foo"' | wc -l)
|
|
46
|
+
n=$($VALGRIND $Q $JQ -n --debug-dump-disasm '"foo" + "bar"' | wc -l)
|
|
47
|
+
if [ $n -ne $nref ]; then
|
|
48
|
+
echo "Constant expression folding for strings didn't work"
|
|
49
|
+
exit 1
|
|
50
|
+
fi
|
|
33
51
|
|
|
34
|
-
# Numeric constant folding (
|
|
52
|
+
# Numeric constant folding (binary operators)
|
|
35
53
|
n=$($VALGRIND $Q $JQ -n --debug-dump-disasm '1+1' | wc -l)
|
|
36
54
|
if [ $n -ne $nref ]; then
|
|
37
|
-
|
|
38
|
-
|
|
55
|
+
echo "Constant expression folding for numbers didn't work"
|
|
56
|
+
exit 1
|
|
39
57
|
fi
|
|
40
58
|
n=$($VALGRIND $Q $JQ -n --debug-dump-disasm '1-1' | wc -l)
|
|
41
59
|
if [ $n -ne $nref ]; then
|
|
42
|
-
|
|
43
|
-
|
|
60
|
+
echo "Constant expression folding for numbers didn't work"
|
|
61
|
+
exit 1
|
|
44
62
|
fi
|
|
45
63
|
n=$($VALGRIND $Q $JQ -n --debug-dump-disasm '2*3' | wc -l)
|
|
46
64
|
if [ $n -ne $nref ]; then
|
|
47
|
-
|
|
48
|
-
|
|
65
|
+
echo "Constant expression folding for numbers didn't work"
|
|
66
|
+
exit 1
|
|
49
67
|
fi
|
|
50
68
|
n=$($VALGRIND $Q $JQ -n --debug-dump-disasm '9/3' | wc -l)
|
|
51
69
|
if [ $n -ne $nref ]; then
|
|
52
|
-
|
|
53
|
-
|
|
70
|
+
echo "Constant expression folding for numbers didn't work"
|
|
71
|
+
exit 1
|
|
72
|
+
fi
|
|
73
|
+
n=$($VALGRIND $Q $JQ -n --debug-dump-disasm '9%3' | wc -l)
|
|
74
|
+
if [ $n -ne $nref ]; then
|
|
75
|
+
echo "Constant expression folding for numbers didn't work"
|
|
76
|
+
exit 1
|
|
54
77
|
fi
|
|
55
78
|
n=$($VALGRIND $Q $JQ -n --debug-dump-disasm '9==3' | wc -l)
|
|
56
79
|
if [ $n -ne $nref ]; then
|
|
57
|
-
|
|
58
|
-
|
|
80
|
+
echo "Constant expression folding for numbers didn't work"
|
|
81
|
+
exit 1
|
|
59
82
|
fi
|
|
60
83
|
n=$($VALGRIND $Q $JQ -n --debug-dump-disasm '9!=3' | wc -l)
|
|
61
84
|
if [ $n -ne $nref ]; then
|
|
62
|
-
|
|
63
|
-
|
|
85
|
+
echo "Constant expression folding for numbers didn't work"
|
|
86
|
+
exit 1
|
|
87
|
+
fi
|
|
88
|
+
n=$($VALGRIND $Q $JQ -n --debug-dump-disasm '9<3' | wc -l)
|
|
89
|
+
if [ $n -ne $nref ]; then
|
|
90
|
+
echo "Constant expression folding for numbers didn't work"
|
|
91
|
+
exit 1
|
|
92
|
+
fi
|
|
93
|
+
n=$($VALGRIND $Q $JQ -n --debug-dump-disasm '9>3' | wc -l)
|
|
94
|
+
if [ $n -ne $nref ]; then
|
|
95
|
+
echo "Constant expression folding for numbers didn't work"
|
|
96
|
+
exit 1
|
|
64
97
|
fi
|
|
65
98
|
n=$($VALGRIND $Q $JQ -n --debug-dump-disasm '9<=3' | wc -l)
|
|
66
99
|
if [ $n -ne $nref ]; then
|
|
67
|
-
|
|
68
|
-
|
|
100
|
+
echo "Constant expression folding for numbers didn't work"
|
|
101
|
+
exit 1
|
|
69
102
|
fi
|
|
70
103
|
n=$($VALGRIND $Q $JQ -n --debug-dump-disasm '9>=3' | wc -l)
|
|
71
104
|
if [ $n -ne $nref ]; then
|
|
72
|
-
|
|
73
|
-
|
|
105
|
+
echo "Constant expression folding for numbers didn't work"
|
|
106
|
+
exit 1
|
|
74
107
|
fi
|
|
75
108
|
|
|
76
109
|
## Test JSON sequence support
|
|
77
110
|
|
|
78
111
|
cat > $d/expected <<EOF
|
|
79
|
-
ignoring parse error: Truncated value at line 2, column 5
|
|
80
|
-
ignoring parse error: Truncated value at line 2, column 25
|
|
81
|
-
ignoring parse error: Truncated value at line 2, column 41
|
|
112
|
+
jq: ignoring parse error: Truncated value at line 2, column 5
|
|
113
|
+
jq: ignoring parse error: Truncated value at line 2, column 25
|
|
114
|
+
jq: ignoring parse error: Truncated value at line 2, column 41
|
|
82
115
|
EOF
|
|
83
116
|
printf '1\0362 3\n[0,1\036[4,5]true"ab"{"c":4\036{}{"d":5,"e":6"\036false\n'|$VALGRIND $Q $JQ -ces --seq '. == [2,3,[4,5],true,"ab",{},false]' > /dev/null 2> $d/out
|
|
84
117
|
cmp $d/out $d/expected
|
|
85
118
|
|
|
86
119
|
cat > $d/expected <<EOF
|
|
87
|
-
ignoring parse error: Truncated value at line 2, column 5
|
|
88
|
-
ignoring parse error: Truncated value at line 2, column 25
|
|
89
|
-
ignoring parse error: Truncated value at line 3, column 1
|
|
120
|
+
jq: ignoring parse error: Truncated value at line 2, column 5
|
|
121
|
+
jq: ignoring parse error: Truncated value at line 2, column 25
|
|
122
|
+
jq: ignoring parse error: Truncated value at line 3, column 1
|
|
90
123
|
EOF
|
|
91
124
|
printf '1\0362 3\n[0,1\036[4,5]true"ab"{"c":4\036{}{"d":5,"e":6"false\n\036null'|$VALGRIND $Q $JQ -ces --seq '. == [2,3,[4,5],true,"ab",{},null]' > /dev/null 2> $d/out
|
|
92
125
|
cmp $d/out $d/expected
|
|
@@ -94,16 +127,22 @@ cmp $d/out $d/expected
|
|
|
94
127
|
# Note that here jq sees no inputs at all but it still succeeds because
|
|
95
128
|
# --seq ignores parse errors
|
|
96
129
|
cat > $d/expected <<EOF
|
|
97
|
-
ignoring parse error: Unfinished abandoned text at EOF at line 1, column 4
|
|
130
|
+
jq: ignoring parse error: Unfinished abandoned text at EOF at line 1, column 4
|
|
98
131
|
EOF
|
|
99
|
-
printf '"foo' | $JQ -
|
|
132
|
+
printf '"foo' | $JQ -c --seq . > $d/out 2>&1
|
|
133
|
+
cmp $d/out $d/expected
|
|
134
|
+
|
|
135
|
+
# with -e option should give 4 here as there's no valid output after
|
|
136
|
+
# ignoring parse errors with --seq.
|
|
137
|
+
printf '"foo' | $JQ -ce --seq . > $d/out 2>&1 || ret=$?
|
|
138
|
+
[ $ret -eq 4 ]
|
|
100
139
|
cmp $d/out $d/expected
|
|
101
140
|
|
|
102
141
|
# Numeric values truncated by EOF are ignored
|
|
103
142
|
cat > $d/expected <<EOF
|
|
104
|
-
ignoring parse error: Unfinished abandoned text at EOF at line 1, column 1
|
|
143
|
+
jq: ignoring parse error: Unfinished abandoned text at EOF at line 1, column 1
|
|
105
144
|
EOF
|
|
106
|
-
printf '1' | $JQ -
|
|
145
|
+
printf '1' | $JQ -c --seq . > $d/out 2>&1
|
|
107
146
|
cmp $d/out $d/expected
|
|
108
147
|
|
|
109
148
|
cat > $d/expected <<EOF
|
|
@@ -115,6 +154,21 @@ if printf '1\n' | $JQ -cen --seq '[inputs] == []' >/dev/null 2> $d/out; then
|
|
|
115
154
|
fi
|
|
116
155
|
cmp $d/out $d/expected
|
|
117
156
|
|
|
157
|
+
|
|
158
|
+
## Test --exit-status
|
|
159
|
+
data='{"i": 1}\n{"i": 2}\n{"i": 3}\n'
|
|
160
|
+
printf "$data" | $JQ --exit-status 'select(.i==1)' > /dev/null 2>&1
|
|
161
|
+
printf "$data" | $JQ --exit-status 'select(.i==2)' > /dev/null 2>&1
|
|
162
|
+
printf "$data" | $JQ --exit-status 'select(.i==3)' > /dev/null 2>&1
|
|
163
|
+
ret=0
|
|
164
|
+
printf "$data" | $JQ --exit-status 'select(.i==4)' > /dev/null 2>&1 || ret=$?
|
|
165
|
+
[ $ret -eq 4 ]
|
|
166
|
+
ret=0
|
|
167
|
+
printf "$data" | $JQ --exit-status 'select(.i==2) | false' > /dev/null 2>&1 || ret=$?
|
|
168
|
+
[ $ret -eq 1 ]
|
|
169
|
+
printf "$data" | $JQ --exit-status 'select(.i==2) | true' > /dev/null 2>&1
|
|
170
|
+
|
|
171
|
+
|
|
118
172
|
# Regression test for #951
|
|
119
173
|
printf '"a\n' > $d/input
|
|
120
174
|
if $VALGRIND $Q $JQ -e . $d/input; then
|
|
@@ -122,6 +176,21 @@ if $VALGRIND $Q $JQ -e . $d/input; then
|
|
|
122
176
|
exit 2
|
|
123
177
|
fi
|
|
124
178
|
|
|
179
|
+
# Regression test for #2146
|
|
180
|
+
if echo "foobar" | $JQ .; then
|
|
181
|
+
printf 'Issue #2146 is back?\n' 1>&2
|
|
182
|
+
exit 1
|
|
183
|
+
elif [ $? -ne 5 ]; then
|
|
184
|
+
echo "Invalid input had wrong error code" 1>&2
|
|
185
|
+
exit 1
|
|
186
|
+
fi
|
|
187
|
+
|
|
188
|
+
# Regression test for #2367; make sure to call jq twice
|
|
189
|
+
if ! echo '{"a": 1E9999999999}' | $JQ . | $JQ -e .a; then
|
|
190
|
+
printf 'Issue #2367 is back?\n' 1>&2
|
|
191
|
+
exit 1
|
|
192
|
+
fi
|
|
193
|
+
|
|
125
194
|
# Regression test for #1534
|
|
126
195
|
echo "[1,2,3,4]" > $d/expected
|
|
127
196
|
printf "[1,2][3,4]" | $JQ -cs add > $d/out 2>&1
|
|
@@ -129,15 +198,56 @@ cmp $d/out $d/expected
|
|
|
129
198
|
printf "[1,2][3,4]\n" | $JQ -cs add > $d/out 2>&1
|
|
130
199
|
cmp $d/out $d/expected
|
|
131
200
|
|
|
201
|
+
# Regression test for --raw-output0
|
|
202
|
+
printf "a\0b\0" > $d/expected
|
|
203
|
+
printf '["a", "b"]' | $VALGRIND $Q $JQ --raw-output0 .[] > $d/out
|
|
204
|
+
cmp $d/out $d/expected
|
|
205
|
+
printf "a\0" > $d/expected
|
|
206
|
+
if printf '["a", "c\\u0000d", "b"]' | $VALGRIND $Q $JQ --raw-output0 .[] > $d/out; then
|
|
207
|
+
echo "Should exit error on string containing NUL with --raw-output0" 1>&2
|
|
208
|
+
exit 1
|
|
209
|
+
elif [ $? -ne 5 ]; then
|
|
210
|
+
echo "Invalid error code" 1>&2
|
|
211
|
+
exit 1
|
|
212
|
+
else
|
|
213
|
+
cmp $d/out $d/expected
|
|
214
|
+
fi
|
|
215
|
+
|
|
216
|
+
# Regression tests for #3194
|
|
217
|
+
echo 42 > $d/expected
|
|
218
|
+
$JQ -nn 42 > $d/out 2>&1
|
|
219
|
+
cmp $d/out $d/expected
|
|
220
|
+
|
|
221
|
+
$JQ -nL. 42 > $d/out 2>&1
|
|
222
|
+
cmp $d/out $d/expected
|
|
223
|
+
$JQ -nL . 42 > $d/out 2>&1
|
|
224
|
+
cmp $d/out $d/expected
|
|
225
|
+
|
|
226
|
+
$JQ -h > $d/expected 2>&1
|
|
227
|
+
$JQ -hV > $d/out 2>&1
|
|
228
|
+
cmp $d/out $d/expected
|
|
229
|
+
$JQ -h -V > $d/out 2>&1
|
|
230
|
+
cmp $d/out $d/expected
|
|
231
|
+
|
|
232
|
+
$JQ -V > $d/expected 2>&1
|
|
233
|
+
$JQ -Vh > $d/out 2>&1
|
|
234
|
+
cmp $d/out $d/expected
|
|
235
|
+
$JQ -V -h > $d/out 2>&1
|
|
236
|
+
cmp $d/out $d/expected
|
|
132
237
|
|
|
133
238
|
## Test streaming parser
|
|
134
239
|
|
|
135
240
|
## If we add an option to stream to the `import ... as $symbol;` directive
|
|
136
241
|
## then we can move these tests into tests/all.test.
|
|
137
|
-
$VALGRIND $Q $JQ -c '. as $d|path(..) as $p|$d|getpath($p)|
|
|
242
|
+
$VALGRIND $Q $JQ -c '. as $d|path(..) as $p|$d|getpath($p)|select((type|. != "array" and . != "object") or length==0)|[$p,.]' < "$JQTESTDIR/torture/input0.json" > $d/out0
|
|
138
243
|
$VALGRIND $Q $JQ --stream -c '.|select(length==2)' < "$JQTESTDIR/torture/input0.json" > $d/out1
|
|
139
244
|
diff $d/out0 $d/out1
|
|
140
245
|
|
|
246
|
+
printf '["Unfinished JSON term at EOF at line 1, column 1",[0]]\n' > $d/expected
|
|
247
|
+
printf '[' | $VALGRIND $Q $JQ --stream-errors -c . > $d/out 2>&1
|
|
248
|
+
diff $d/out $d/expected
|
|
249
|
+
|
|
250
|
+
|
|
141
251
|
## XXX This test can be moved to tests/all.test _now_
|
|
142
252
|
clean=false
|
|
143
253
|
if which seq > /dev/null 2>&1; then
|
|
@@ -159,7 +269,7 @@ if which seq > /dev/null 2>&1; then
|
|
|
159
269
|
if [ -n "$VALGRIND" ]; then
|
|
160
270
|
grep '^==[0-9][0-9]*== ERROR SUMMARY: 0 errors' $d/err > /dev/null
|
|
161
271
|
else
|
|
162
|
-
tail -
|
|
272
|
+
tail -n1 -- "$d/err" | grep -Ei 'assert|abort|core' && false
|
|
163
273
|
fi
|
|
164
274
|
|
|
165
275
|
dd "if=tests/torture/input0.json" bs=$i count=1 2>/dev/null |
|
|
@@ -167,7 +277,7 @@ if which seq > /dev/null 2>&1; then
|
|
|
167
277
|
if [ -n "$VALGRIND" ]; then
|
|
168
278
|
grep '^==[0-9][0-9]*== ERROR SUMMARY: 0 errors' $d/err > /dev/null
|
|
169
279
|
else
|
|
170
|
-
tail -
|
|
280
|
+
tail -n1 -- "$d/err" | grep -Ei 'assert|abort|core' && false
|
|
171
281
|
fi
|
|
172
282
|
|
|
173
283
|
diff $d/out0 $d/out1
|
|
@@ -176,6 +286,78 @@ else
|
|
|
176
286
|
echo "Not doing torture tests"
|
|
177
287
|
fi
|
|
178
288
|
|
|
289
|
+
## Regression test for issue #2378 assert when stream parse broken object pair
|
|
290
|
+
echo '{"a":1,"b",' | $JQ --stream > /dev/null 2> $d/err || true
|
|
291
|
+
grep 'Objects must consist of key:value pairs' $d/err > /dev/null
|
|
292
|
+
|
|
293
|
+
## Regression tests for issue #2463 assert when stream parse non-scalar object key
|
|
294
|
+
echo '{{"a":"b"}}' | $JQ --stream > /dev/null 2> $d/err || true
|
|
295
|
+
grep "Expected string key after '{', not '{'" $d/err > /dev/null
|
|
296
|
+
echo '{"x":"y",{"a":"b"}}' | $JQ --stream > /dev/null 2> $d/err || true
|
|
297
|
+
grep "Expected string key after ',' in object, not '{'" $d/err > /dev/null
|
|
298
|
+
echo '{["a","b"]}' | $JQ --stream > /dev/null 2> $d/err || true
|
|
299
|
+
grep "Expected string key after '{', not '\\['" $d/err > /dev/null
|
|
300
|
+
echo '{"x":"y",["a","b"]}' | $JQ --stream > /dev/null 2> $d/err || true
|
|
301
|
+
grep "Expected string key after ',' in object, not '\\['" $d/err > /dev/null
|
|
302
|
+
|
|
303
|
+
# debug, stderr
|
|
304
|
+
$VALGRIND $Q $JQ -n '"test", {} | debug, stderr' >/dev/null
|
|
305
|
+
$JQ -n -c -j '"hello\nworld", null, [false, 0], {"foo":["bar"]}, "\n" | stderr' >$d/out 2>$d/err
|
|
306
|
+
cat > $d/expected <<'EOF'
|
|
307
|
+
hello
|
|
308
|
+
worldnull[false,0]{"foo":["bar"]}
|
|
309
|
+
EOF
|
|
310
|
+
cmp $d/out $d/expected
|
|
311
|
+
cmp $d/err $d/expected
|
|
312
|
+
|
|
313
|
+
# --arg, --argjson, $ARGS.named
|
|
314
|
+
$VALGRIND $JQ -n -c --arg foo 1 --argjson bar 2 '{$foo, $bar} | ., . == $ARGS.named' > $d/out
|
|
315
|
+
printf '{"foo":"1","bar":2}\ntrue\n' > $d/expected
|
|
316
|
+
cmp $d/out $d/expected
|
|
317
|
+
|
|
318
|
+
# --slurpfile, --rawfile
|
|
319
|
+
$VALGRIND $JQ -n --slurpfile foo $JQBASEDIR/tests/modules/data.json \
|
|
320
|
+
--rawfile bar $JQBASEDIR/tests/modules/data.json '{$foo, $bar}' > $d/out
|
|
321
|
+
cat > $d/expected <<'EOF'
|
|
322
|
+
{
|
|
323
|
+
"foo": [
|
|
324
|
+
{
|
|
325
|
+
"this": "is a test",
|
|
326
|
+
"that": "is too"
|
|
327
|
+
}
|
|
328
|
+
],
|
|
329
|
+
"bar": "{\n \"this\": \"is a test\",\n \"that\": \"is too\"\n}\n"
|
|
330
|
+
}
|
|
331
|
+
EOF
|
|
332
|
+
cmp $d/out $d/expected
|
|
333
|
+
|
|
334
|
+
# --args, --jsonargs, $ARGS.positional
|
|
335
|
+
$VALGRIND $JQ -n -c --args '$ARGS.positional' foo bar baz > $d/out
|
|
336
|
+
printf '["foo","bar","baz"]\n' > $d/expected
|
|
337
|
+
cmp $d/out $d/expected
|
|
338
|
+
$VALGRIND $JQ -n -c --jsonargs '$ARGS.positional' null true '[]' '{}' > $d/out
|
|
339
|
+
printf '[null,true,[],{}]\n' > $d/expected
|
|
340
|
+
cmp $d/out $d/expected
|
|
341
|
+
$VALGRIND $JQ -n -c '$ARGS.positional' --args foo 1 --jsonargs 2 '{}' --args 3 4 > $d/out
|
|
342
|
+
printf '["foo","1",2,{},"3","4"]\n' > $d/expected
|
|
343
|
+
cmp $d/out $d/expected
|
|
344
|
+
$VALGRIND $JQ -n -c '$ARGS.positional' --args --jsonargs > $d/out
|
|
345
|
+
printf '[]\n' > $d/expected
|
|
346
|
+
cmp $d/out $d/expected
|
|
347
|
+
|
|
348
|
+
## Regression test for issue #2572 assert when using --jsonargs and invalid JSON
|
|
349
|
+
$VALGRIND $JQ -n --jsonargs null invalid && EC=$? || EC=$?
|
|
350
|
+
if [ "$EC" -ne 2 ]; then
|
|
351
|
+
echo "--jsonargs exited with wrong exit code, expected 2 got $EC" 1>&2
|
|
352
|
+
exit 1
|
|
353
|
+
fi
|
|
354
|
+
# this tests the args_done code path "--"
|
|
355
|
+
$VALGRIND $JQ -n --jsonargs null -- invalid && EC=$? || EC=$?
|
|
356
|
+
if [ "$EC" -ne 2 ]; then
|
|
357
|
+
echo "--jsonargs exited with wrong exit code, expected 2 got $EC" 1>&2
|
|
358
|
+
exit 1
|
|
359
|
+
fi
|
|
360
|
+
|
|
179
361
|
## Fuzz parser
|
|
180
362
|
|
|
181
363
|
## XXX With a $(urandom) builtin we could move this test into tests/all.test
|
|
@@ -197,16 +379,32 @@ clean=true
|
|
|
197
379
|
|
|
198
380
|
# Check handling of ~/.jq; these can't move into jq_test.c yet because
|
|
199
381
|
# they depend on $HOME
|
|
200
|
-
if [ "$(HOME="$mods" $VALGRIND $Q $JQ -nr fg)" != foobar ]; then
|
|
382
|
+
if [ "$(HOME="$mods/home1" $VALGRIND $Q $JQ -nr fg)" != foobar ]; then
|
|
201
383
|
echo "Bug #479 appears to be back" 1>&2
|
|
202
384
|
exit 1
|
|
203
385
|
fi
|
|
204
386
|
|
|
205
|
-
if
|
|
387
|
+
if $msys || $mingw; then
|
|
388
|
+
HOME_BAK=$HOME
|
|
389
|
+
unset HOME
|
|
390
|
+
if [ "$(USERPROFILE="$mods/home1" $VALGRIND $Q $JQ -nr foo)" != baz ]; then
|
|
391
|
+
echo "Bug #3104 regressed (sourcing %USERPROFILE%/.jq on Windows)" 1>&2
|
|
392
|
+
exit 1
|
|
393
|
+
fi
|
|
394
|
+
export HOME=$HOME_BAK
|
|
395
|
+
unset HOME_BAK
|
|
396
|
+
fi
|
|
397
|
+
|
|
398
|
+
if [ $(HOME="$mods/home1" $VALGRIND $Q $JQ --debug-dump-disasm -n fg | grep '^[a-z]' | wc -l) -ne 3 ]; then
|
|
206
399
|
echo "Binding too many defs into program" 1>&2
|
|
207
400
|
exit 1
|
|
208
401
|
fi
|
|
209
402
|
|
|
403
|
+
if ! HOME="$mods/home2" $VALGRIND $Q $JQ -n 'include "g"; empty'; then
|
|
404
|
+
echo "Mishandling directory ~/.jq" 1>&2
|
|
405
|
+
exit 1
|
|
406
|
+
fi
|
|
407
|
+
|
|
210
408
|
cd "$JQBASEDIR" # so that relative library paths are guaranteed correct
|
|
211
409
|
if ! $VALGRIND $Q $JQ -L ./tests/modules -ne 'import "test_bind_order" as check; check::check==true'; then
|
|
212
410
|
echo "Issue #817 regression?" 1>&2
|
|
@@ -243,39 +441,128 @@ if [ -n "$($VALGRIND $Q $JQ -n 'halt_error(1)' 2>&1)" ]; then
|
|
|
243
441
|
echo "jq halt_error(1) had unexpected output" 1>&2
|
|
244
442
|
exit 1
|
|
245
443
|
fi
|
|
246
|
-
if [ -n "$($VALGRIND $Q $JQ -n '"xyz\n"|halt_error(1)' 2>/dev/null)" ]; then
|
|
444
|
+
if [ -n "$($VALGRIND $Q $JQ -n '"xyz\n" | halt_error(1)' 2>/dev/null)" ]; then
|
|
247
445
|
echo "jq halt_error(1) had unexpected output on stdout" 1>&2
|
|
248
446
|
exit 1
|
|
249
447
|
fi
|
|
250
|
-
if [ "$($VALGRIND $Q $JQ -n '"
|
|
448
|
+
if [ "$($VALGRIND $Q $JQ -n '"xy" | halt_error(1)' 2>&1 || echo "z")" != "xyz" ]; then
|
|
449
|
+
echo "jq halt_error(1) had unexpected output" 1>&2
|
|
450
|
+
exit 1
|
|
451
|
+
fi
|
|
452
|
+
if [ "$($VALGRIND $Q $JQ -n '"x\u0000y\u0000z" | halt_error(1)' 2>&1 | tr '\0' '.')" != "x.y.z" ]; then
|
|
453
|
+
echo "jq halt_error(1) had unexpected output" 1>&2
|
|
454
|
+
exit 1
|
|
455
|
+
fi
|
|
456
|
+
if [ "$($VALGRIND $Q $JQ -n '{"a":"xyz"} | halt_error(1)' 2>&1)" != '{"a":"xyz"}' ]; then
|
|
251
457
|
echo "jq halt_error(1) had unexpected output" 1>&2
|
|
252
458
|
exit 1
|
|
253
459
|
fi
|
|
254
460
|
|
|
255
461
|
# Check $JQ_COLORS
|
|
462
|
+
unset JQ_COLORS
|
|
463
|
+
|
|
464
|
+
## Default colors, null input
|
|
256
465
|
$JQ -Ccn . > $d/color
|
|
257
|
-
printf '\033[
|
|
466
|
+
printf '\033[0;90mnull\033[0m\n' > $d/expect
|
|
258
467
|
cmp $d/color $d/expect
|
|
468
|
+
|
|
469
|
+
## Set non-default color, null input
|
|
259
470
|
JQ_COLORS='4;31' $JQ -Ccn . > $d/color
|
|
260
471
|
printf '\033[4;31mnull\033[0m\n' > $d/expect
|
|
261
472
|
cmp $d/color $d/expect
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
printf '\033[
|
|
267
|
-
printf '
|
|
268
|
-
printf '
|
|
269
|
-
printf ';
|
|
270
|
-
printf '
|
|
271
|
-
printf '
|
|
272
|
-
printf '
|
|
273
|
-
printf '
|
|
274
|
-
printf '0;
|
|
275
|
-
printf '
|
|
276
|
-
printf '
|
|
277
|
-
printf '
|
|
278
|
-
|
|
473
|
+
|
|
474
|
+
## Default colors, complex input
|
|
475
|
+
$JQ -Ccn '[{"a":true,"b":false},"abc",123,null]' > $d/color
|
|
476
|
+
{
|
|
477
|
+
printf '\033[1;39m[\033[0m'
|
|
478
|
+
printf '\033[1;39m{\033[0m'
|
|
479
|
+
printf '\033[1;34m"a"\033[0m'
|
|
480
|
+
printf '\033[1;39m:\033[0m'
|
|
481
|
+
printf '\033[0;39mtrue\033[0m'
|
|
482
|
+
printf '\033[1;39m,\033[0m'
|
|
483
|
+
printf '\033[1;34m"b"\033[0m'
|
|
484
|
+
printf '\033[1;39m:\033[0m'
|
|
485
|
+
printf '\033[0;39mfalse\033[0m'
|
|
486
|
+
printf '\033[1;39m}\033[0m'
|
|
487
|
+
printf '\033[1;39m,\033[0m'
|
|
488
|
+
printf '\033[0;32m"abc"\033[0m'
|
|
489
|
+
printf '\033[1;39m,\033[0m'
|
|
490
|
+
printf '\033[0;39m123\033[0m'
|
|
491
|
+
printf '\033[1;39m,\033[0m'
|
|
492
|
+
printf '\033[0;90mnull\033[0m'
|
|
493
|
+
printf '\033[1;39m]\033[0m\n'
|
|
494
|
+
} > $d/expect
|
|
495
|
+
cmp $d/color $d/expect
|
|
496
|
+
|
|
497
|
+
## Set non-default colors, complex input
|
|
498
|
+
JQ_COLORS='0;30:0;31:0;32:0;33:0;34:1;35:1;36:1;37' \
|
|
499
|
+
$JQ -Ccn '[{"a":true,"b":false},"abc",123,null]' > $d/color
|
|
500
|
+
{
|
|
501
|
+
printf '\033[1;35m[\033[0m'
|
|
502
|
+
printf '\033[1;36m{\033[0m'
|
|
503
|
+
printf '\033[1;37m"a"\033[0m'
|
|
504
|
+
printf '\033[1;36m:\033[0m'
|
|
505
|
+
printf '\033[0;32mtrue\033[0m'
|
|
506
|
+
printf '\033[1;36m,\033[0m'
|
|
507
|
+
printf '\033[1;37m"b"\033[0m'
|
|
508
|
+
printf '\033[1;36m:\033[0m'
|
|
509
|
+
printf '\033[0;31mfalse\033[0m'
|
|
510
|
+
printf '\033[1;36m}\033[0m'
|
|
511
|
+
printf '\033[1;35m,\033[0m'
|
|
512
|
+
printf '\033[0;34m"abc"\033[0m'
|
|
513
|
+
printf '\033[1;35m,\033[0m'
|
|
514
|
+
printf '\033[0;33m123\033[0m'
|
|
515
|
+
printf '\033[1;35m,\033[0m'
|
|
516
|
+
printf '\033[0;30mnull\033[0m'
|
|
517
|
+
printf '\033[1;35m]\033[0m\n'
|
|
518
|
+
} > $d/expect
|
|
519
|
+
cmp $d/color $d/expect
|
|
520
|
+
|
|
521
|
+
## Default colors, complex input, indented
|
|
522
|
+
$JQ -Cn '[{"a":true,"b":false},"abc",123,null]' > $d/color
|
|
523
|
+
{
|
|
524
|
+
printf '\033[1;39m[\033[0m\n'
|
|
525
|
+
printf ' \033[1;39m{\033[0m\n'
|
|
526
|
+
printf ' \033[1;34m"a"\033[0m'
|
|
527
|
+
printf '\033[1;39m:\033[0m '
|
|
528
|
+
printf '\033[0;39mtrue\033[0m'
|
|
529
|
+
printf '\033[1;39m,\033[0m\n'
|
|
530
|
+
printf ' \033[1;34m"b"\033[0m'
|
|
531
|
+
printf '\033[1;39m:\033[0m '
|
|
532
|
+
printf '\033[0;39mfalse\033[0m\n'
|
|
533
|
+
printf ' \033[1;39m}\033[0m'
|
|
534
|
+
printf '\033[1;39m,\033[0m\n'
|
|
535
|
+
printf ' \033[0;32m"abc"\033[0m'
|
|
536
|
+
printf '\033[1;39m,\033[0m\n'
|
|
537
|
+
printf ' \033[0;39m123\033[0m'
|
|
538
|
+
printf '\033[1;39m,\033[0m\n'
|
|
539
|
+
printf ' \033[0;90mnull\033[0m\n'
|
|
540
|
+
printf '\033[1;39m]\033[0m\n'
|
|
541
|
+
} > $d/expect
|
|
542
|
+
cmp $d/color $d/expect
|
|
543
|
+
|
|
544
|
+
## Set non-default colors, complex input, indented
|
|
545
|
+
JQ_COLORS='0;30:0;31:0;32:0;33:0;34:1;35:1;36:1;37' \
|
|
546
|
+
$JQ -Cn '[{"a":true,"b":false},"abc",123,null]' > $d/color
|
|
547
|
+
{
|
|
548
|
+
printf '\033[1;35m[\033[0m\n'
|
|
549
|
+
printf ' \033[1;36m{\033[0m\n'
|
|
550
|
+
printf ' \033[1;37m"a"\033[0m'
|
|
551
|
+
printf '\033[1;36m:\033[0m '
|
|
552
|
+
printf '\033[0;32mtrue\033[0m'
|
|
553
|
+
printf '\033[1;36m,\033[0m\n'
|
|
554
|
+
printf ' \033[1;37m"b"\033[0m'
|
|
555
|
+
printf '\033[1;36m:\033[0m '
|
|
556
|
+
printf '\033[0;31mfalse\033[0m\n'
|
|
557
|
+
printf ' \033[1;36m}\033[0m'
|
|
558
|
+
printf '\033[1;35m,\033[0m\n'
|
|
559
|
+
printf ' \033[0;34m"abc"\033[0m'
|
|
560
|
+
printf '\033[1;35m,\033[0m\n'
|
|
561
|
+
printf ' \033[0;33m123\033[0m'
|
|
562
|
+
printf '\033[1;35m,\033[0m\n'
|
|
563
|
+
printf ' \033[0;30mnull\033[0m\n'
|
|
564
|
+
printf '\033[1;35m]\033[0m\n'
|
|
565
|
+
} > $d/expect
|
|
279
566
|
cmp $d/color $d/expect
|
|
280
567
|
|
|
281
568
|
# Check garbage in JQ_COLORS. We write each color sequence into a 16
|
|
@@ -284,26 +571,158 @@ cmp $d/color $d/expect
|
|
|
284
571
|
# on stderr.
|
|
285
572
|
set -vx
|
|
286
573
|
echo 'Failed to set $JQ_COLORS' > $d/expect_warning
|
|
287
|
-
$JQ -Ccn '[{"a":true,"b":false},123,null]' > $d/expect
|
|
574
|
+
$JQ -Ccn '[{"a":true,"b":false},"abc",123,null]' > $d/expect
|
|
288
575
|
JQ_COLORS='garbage;30:*;31:,;3^:0;$%:0;34:1;35:1;36' \
|
|
289
|
-
$JQ -Ccn '[{"a":true,"b":false},123,null]' > $d/color 2>$d/warning
|
|
576
|
+
$JQ -Ccn '[{"a":true,"b":false},"abc",123,null]' > $d/color 2>$d/warning
|
|
290
577
|
cmp $d/color $d/expect
|
|
291
578
|
cmp $d/warning $d/expect_warning
|
|
292
579
|
JQ_COLORS='1234567890123456789;30:0;31:0;32:0;33:0;34:1;35:1;36' \
|
|
293
|
-
$JQ -Ccn '[{"a":true,"b":false},123,null]' > $d/color 2>$d/warning
|
|
580
|
+
$JQ -Ccn '[{"a":true,"b":false},"abc",123,null]' > $d/color 2>$d/warning
|
|
294
581
|
cmp $d/color $d/expect
|
|
295
582
|
cmp $d/warning $d/expect_warning
|
|
296
583
|
JQ_COLORS='1;31234567890123456789:0;31:0;32:0;33:0;34:1;35:1;36' \
|
|
297
|
-
$JQ -Ccn '[{"a":true,"b":false},123,null]' > $d/color 2>$d/warning
|
|
584
|
+
$JQ -Ccn '[{"a":true,"b":false},"abc",123,null]' > $d/color 2>$d/warning
|
|
298
585
|
cmp $d/color $d/expect
|
|
299
586
|
cmp $d/warning $d/expect_warning
|
|
300
587
|
JQ_COLORS='1234567890123456;1234567890123456:1234567890123456;1234567890123456:1234567890123456;1234567890123456:1234567890123456;1234567890123456:1234567890123456;1234567890123456:1234567890123456;1234567890123456:1234567890123456;1234567890123456' \
|
|
301
|
-
$JQ -Ccn '[{"a":true,"b":false},123,null]' > $d/color 2>$d/warning
|
|
588
|
+
$JQ -Ccn '[{"a":true,"b":false},"abc",123,null]' > $d/color 2>$d/warning
|
|
302
589
|
cmp $d/color $d/expect
|
|
303
590
|
cmp $d/warning $d/expect_warning
|
|
304
591
|
JQ_COLORS="0123456789123:0123456789123:0123456789123:0123456789123:0123456789123:0123456789123:0123456789123:0123456789123:" \
|
|
305
|
-
$JQ -Ccn '[{"a":true,"b":false},123,null]' > $d/color 2>$d/warning
|
|
592
|
+
$JQ -Ccn '[{"a":true,"b":false},"abc",123,null]' > $d/color 2>$d/warning
|
|
306
593
|
cmp $d/color $d/expect
|
|
307
594
|
cmp $d/warning $d/expect_warning
|
|
308
595
|
|
|
596
|
+
# Check $NO_COLOR
|
|
597
|
+
test_no_color=true
|
|
598
|
+
$msys && test_no_color=false
|
|
599
|
+
$mingw && test_no_color=false
|
|
600
|
+
if $test_no_color && command -v script >/dev/null 2>&1; then
|
|
601
|
+
unset NO_COLOR
|
|
602
|
+
if script -qc echo /dev/null >/dev/null 2>&1; then
|
|
603
|
+
faketty() { script -qec "$*" /dev/null; }
|
|
604
|
+
else # macOS
|
|
605
|
+
faketty() { script -q /dev/null "$@" /dev/null |
|
|
606
|
+
sed 's/^\x5E\x44\x08\x08//'; }
|
|
607
|
+
fi
|
|
608
|
+
|
|
609
|
+
faketty $JQ_NO_B -n . > $d/color
|
|
610
|
+
printf '\033[0;90mnull\033[0m\r\n' > $d/expect
|
|
611
|
+
od -tc $d/expect
|
|
612
|
+
od -tc $d/color
|
|
613
|
+
cmp $d/color $d/expect
|
|
614
|
+
faketty env NO_COLOR= $JQ_NO_B -n . > $d/color
|
|
615
|
+
printf '\033[0;90mnull\033[0m\r\n' > $d/expect
|
|
616
|
+
od -tc $d/expect
|
|
617
|
+
od -tc $d/color
|
|
618
|
+
cmp $d/color $d/expect
|
|
619
|
+
faketty env NO_COLOR=1 $JQ_NO_B -n . > $d/color
|
|
620
|
+
printf 'null\r\n' > $d/expect
|
|
621
|
+
od -tc $d/expect
|
|
622
|
+
od -tc $d/color
|
|
623
|
+
cmp $d/color $d/expect
|
|
624
|
+
faketty env NO_COLOR=1 $JQ_NO_B -Cn . > $d/color
|
|
625
|
+
printf '\033[0;90mnull\033[0m\r\n' > $d/expect
|
|
626
|
+
od -tc $d/expect
|
|
627
|
+
od -tc $d/color
|
|
628
|
+
cmp $d/color $d/expect
|
|
629
|
+
fi
|
|
630
|
+
|
|
631
|
+
# #2785
|
|
632
|
+
if $VALGRIND $Q $JQ -n -f "$JQTESTDIR/no-main-program.jq" > $d/out 2>&1; then
|
|
633
|
+
echo "jq -f $JQTESTDIR/no-main-program.jq succeeded"
|
|
634
|
+
exit 1
|
|
635
|
+
else
|
|
636
|
+
EC=$?
|
|
637
|
+
if [ $EC -eq 1 ]; then
|
|
638
|
+
echo "jq -f $JQTESTDIR/no-main-program.jq failed with memory errors"
|
|
639
|
+
exit 1
|
|
640
|
+
fi
|
|
641
|
+
if [ $EC -ne 3 ]; then
|
|
642
|
+
echo "jq -f $JQTESTDIR/no-main-program.jq failed with wrong exit code ($EC)"
|
|
643
|
+
exit 1
|
|
644
|
+
fi
|
|
645
|
+
fi
|
|
646
|
+
cat > $d/expected <<EOF
|
|
647
|
+
jq: error: Top-level program not given (try ".")
|
|
648
|
+
jq: 1 compile error
|
|
649
|
+
EOF
|
|
650
|
+
if ! diff $d/expected $d/out; then
|
|
651
|
+
echo "jq -f $JQTESTDIR/no-main-program.jq failed but its error message is not the expected one"
|
|
652
|
+
exit 1
|
|
653
|
+
fi
|
|
654
|
+
|
|
655
|
+
if ! $VALGRIND $Q $JQ -n -f "$JQTESTDIR/yes-main-program.jq" > $d/out 2>&1; then
|
|
656
|
+
echo "jq -f $JQTESTDIR/yes-main-program.jq failed"
|
|
657
|
+
exit 1
|
|
658
|
+
fi
|
|
659
|
+
|
|
660
|
+
if ! $msys && ! $mingw && locales=$(locale -a); then
|
|
661
|
+
{ l=$(grep -Ev '^(C|LANG|POSIX|en)' | grep -Ei '\.utf-?8$' | head -n1) ;} \
|
|
662
|
+
<<EOF
|
|
663
|
+
$locales
|
|
664
|
+
EOF
|
|
665
|
+
if [ -z "$l" ]; then
|
|
666
|
+
echo "WARNING: Not testing localization"
|
|
667
|
+
else
|
|
668
|
+
date=$(LC_ALL=$l date +'%a %d %b %Y at %H:%M:%S')
|
|
669
|
+
if ! LC_ALL=$l $JQ -nR --arg date "$date" '$date|strptime("%a %d %b %Y at %H:%M:%S")'; then
|
|
670
|
+
echo "jq does not honor LC_ALL environment variable"
|
|
671
|
+
exit 1
|
|
672
|
+
fi
|
|
673
|
+
fi
|
|
674
|
+
fi
|
|
675
|
+
|
|
676
|
+
# Comments!
|
|
677
|
+
if ! x=$($JQ -n '123 # comment') || [ "$x" != 123 ]; then
|
|
678
|
+
echo 'comment did not work'
|
|
679
|
+
exit 1
|
|
680
|
+
fi
|
|
681
|
+
|
|
682
|
+
cr=$(printf \\r)
|
|
683
|
+
if ! x=$($JQ -n "1 # foo$cr + 2") || [ "$x" != 1 ]; then
|
|
684
|
+
echo 'regression: carriage return terminates comment'
|
|
685
|
+
exit 1
|
|
686
|
+
fi
|
|
687
|
+
|
|
688
|
+
if ! x=$($JQ -cn '[
|
|
689
|
+
1,
|
|
690
|
+
# foo \
|
|
691
|
+
2,
|
|
692
|
+
# bar \\
|
|
693
|
+
3,
|
|
694
|
+
4, # baz \\\
|
|
695
|
+
5, \
|
|
696
|
+
6,
|
|
697
|
+
7
|
|
698
|
+
# comment \
|
|
699
|
+
comment \
|
|
700
|
+
comment
|
|
701
|
+
]') || [ "$x" != '[1,3,4,7]' ]; then
|
|
702
|
+
echo 'multiline comment was not handled correctly'
|
|
703
|
+
exit 1
|
|
704
|
+
fi
|
|
705
|
+
|
|
706
|
+
# CVE-2023-50268: No stack overflow comparing a nan with a large payload
|
|
707
|
+
if $JQ -ne 'have_decnum'; then
|
|
708
|
+
$VALGRIND $Q $JQ '1 != .' <<\EOF >/dev/null
|
|
709
|
+
Nan4000
|
|
710
|
+
EOF
|
|
711
|
+
fi
|
|
712
|
+
|
|
713
|
+
# Allow passing the inline jq script before -- #2919
|
|
714
|
+
if ! r=$($JQ --args -rn -- '$ARGS.positional[0]' bar) || [ "$r" != bar ]; then
|
|
715
|
+
echo "passing the inline script after -- didn't work"
|
|
716
|
+
exit 1
|
|
717
|
+
fi
|
|
718
|
+
if ! r=$($JQ --args -rn 1 -- '$ARGS.positional[0]' bar) || [ "$r" != 1 ]; then
|
|
719
|
+
echo "passing the inline script before -- didn't work"
|
|
720
|
+
exit 1
|
|
721
|
+
fi
|
|
722
|
+
|
|
723
|
+
# CVE-2023-50246: No heap overflow for '-10E-1000000001'
|
|
724
|
+
$VALGRIND $Q $JQ . <<\NUM
|
|
725
|
+
-10E-1000000001
|
|
726
|
+
NUM
|
|
727
|
+
|
|
309
728
|
exit 0
|