Enable more tests on Windows; move sort_by tests
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Use %%FAIL IGNORE MSG for error messages that differ on Windows, and move the sort_by/group_by tests that fail qhen qsort() is not stable. Now only tests/sorttest and tests/shtest are disabled on Windows.
authored by Nicolas Williams · committed by Nicolas Williams · parent c3d1326 · Browse files · 5 files·+38 added−17 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
5 files+38 added−17 removed
- tests:+36 added−15 removed
- other:+2 added−2 removed
Provenance
- Commit
062f86a- Tree
8873b41- Author
Nicolas Williams <nico@cryptonector.com>- Committer
Nicolas Williams <nico@cryptonector.com>- Parent
c3d1326
5 files changed+38 added−17 removed
modified:tests/jq.test+7 added-15 removed
417 unmodified lines418 . as [$i] | . as $i | $i419 [0]420 [0]421 422-%%FAIL422+%%FAIL IGNORE MSG423 . as [] | null424 jq: error: syntax error, unexpected ']', expecting '$' or '[' or '{' (Unix shell quoting issues?) at <top-level>, line 1:425 426-%%FAIL426+%%FAIL IGNORE MSG427 . as {} | null428 jq: error: syntax error, unexpected '}' (Unix shell quoting issues?) at <top-level>, line 1:429 430 # [.,(.[] | {x:.},.),.,.[]]612 unmodified lines1043 sort1044 [42,[2,5,3,11],10,{"a":42,"b":2},{"a":42},true,2,[2,6],"hello",null,[2,5,6],{"a":[],"b":1},"abc","ab",[3,10],{},false,"abcd",null]1045 [null,null,false,true,2,10,42,"ab","abc","abcd","hello",[2,5,3,11],[2,5,6],[2,6],[3,10],{},{"a":42},{"a":42,"b":2},{"a":[],"b":1}]1046 1047-(sort_by(.b) | sort_by(.a)), sort_by(.a, .b), sort_by(.b, .c), group_by(.b), group_by(.a + .b - .c == 2)1048-[{"a": 1, "b": 4, "c": 14}, {"a": 4, "b": 1, "c": 3}, {"a": 1, "b": 4, "c": 3}, {"a": 0, "b": 2, "c": 43}]1049-[{"a": 0, "b": 2, "c": 43}, {"a": 1, "b": 4, "c": 14}, {"a": 1, "b": 4, "c": 3}, {"a": 4, "b": 1, "c": 3}]1050-[{"a": 0, "b": 2, "c": 43}, {"a": 1, "b": 4, "c": 14}, {"a": 1, "b": 4, "c": 3}, {"a": 4, "b": 1, "c": 3}]1051-[{"a": 4, "b": 1, "c": 3}, {"a": 0, "b": 2, "c": 43}, {"a": 1, "b": 4, "c": 3}, {"a": 1, "b": 4, "c": 14}]1052-[[{"a": 4, "b": 1, "c": 3}], [{"a": 0, "b": 2, "c": 43}], [{"a": 1, "b": 4, "c": 14}, {"a": 1, "b": 4, "c": 3}]]1053-[[{"a": 1, "b": 4, "c": 14}, {"a": 0, "b": 2, "c": 43}], [{"a": 4, "b": 1, "c": 3}, {"a": 1, "b": 4, "c": 3}]]1047+# Tests of `sort_by` and `group_by` have been moved to tests/sort.test1048 1049 unique1050 [1,2,5,3,5,3,1,3]1051 [1,2,3,5]131 unmodified lines1183 bsearch(4)1184 [1,2,3]1185 -41186 1193-[strptime("%Y-%m-%dT%H:%M:%SZ")|(.,mktime)]1194-"2015-03-05T23:51:47Z"1195-[[2015,2,5,23,51,47,4,63],1425599507]1187+# strptime tests are in optional.test1188 1189 strftime("%Y-%m-%dT%H:%M:%SZ")1190 [2015,2,5,23,51,47,4,63]1191 "2015-03-05T23:51:47Z"1192 1201-strftime("%A, %B %e, %Y")1193+strftime("%A, %B %d, %Y")1194 1435677542.8223511195 "Tuesday, June 30, 2015"1196 1197 gmtime40 unmodified lines1238 %%FAIL IGNORE MSG1239 import "syntaxerror" as e; .1240 jq: error: syntax error, unexpected ';', expecting $end (Unix shell quoting issues?) at /home/nico/ws/jq/tests/modules/syntaxerror/syntaxerror.jq, line 1:1241 1250-%%FAIL1242+%%FAIL IGNORE MSG1243 %::wat1244 jq: error: syntax error, unexpected '%', expecting $end (Unix shell quoting issues?) at <top-level>, line 1:1245 1246 import "test_bind_order" as check; check::check51 unmodified lines1298 1299 [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)1300 null1301 1310-%%FAIL1302+%%FAIL IGNORE MSG1303 }1304 jq: error: syntax error, unexpected INVALID_CHARACTER, expecting $end (Unix shell quoting issues?) at <top-level>, line 1:1305 1306 (.[{}] = 0)?3 unmodified linesadded:tests/optional.test+24 added
1+# See tests/jq.test and the jq manual for more information.2+3+# As long as we use the C qsort() function, this test can fail if the C4+# qsort() implementation we get is not stable (Quicksort is not stable).5+6+(sort_by(.b) | sort_by(.a)), sort_by(.a, .b), sort_by(.b, .c), group_by(.b), group_by(.a + .b - .c == 2)7+[{"a": 1, "b": 4, "c": 14}, {"a": 4, "b": 1, "c": 3}, {"a": 1, "b": 4, "c": 3}, {"a": 0, "b": 2, "c": 43}]8+[{"a": 0, "b": 2, "c": 43}, {"a": 1, "b": 4, "c": 14}, {"a": 1, "b": 4, "c": 3}, {"a": 4, "b": 1, "c": 3}]9+[{"a": 0, "b": 2, "c": 43}, {"a": 1, "b": 4, "c": 14}, {"a": 1, "b": 4, "c": 3}, {"a": 4, "b": 1, "c": 3}]10+[{"a": 4, "b": 1, "c": 3}, {"a": 0, "b": 2, "c": 43}, {"a": 1, "b": 4, "c": 3}, {"a": 1, "b": 4, "c": 14}]11+[[{"a": 4, "b": 1, "c": 3}], [{"a": 0, "b": 2, "c": 43}], [{"a": 1, "b": 4, "c": 14}, {"a": 1, "b": 4, "c": 3}]]12+[[{"a": 1, "b": 4, "c": 14}, {"a": 0, "b": 2, "c": 43}], [{"a": 4, "b": 1, "c": 3}, {"a": 1, "b": 4, "c": 3}]]13+14+# strptime() is not available on mingw/WIN3215+[strptime("%Y-%m-%dT%H:%M:%SZ")|(.,mktime)]16+"2015-03-05T23:51:47Z"17+[[2015,2,5,23,51,47,4,63],1425599507]18+19+# %e is not available on mingw/WIN3220+strftime("%A, %B %e, %Y")21+1435677542.82235122+"Tuesday, June 30, 2015"23+24+added:tests/optionaltest+5 added
1+#!/bin/sh2+3+. "${0%/*}/setup"4+5+$VALGRIND $Q $JQ -L "$mods" --run-tests $JQTESTDIR/optional.testmodified:appveyor.yml+1 added-1 removed
22 unmodified lines2324252627272829303114 unmodified lines22 unmodified lines - bash -lc "exec 0</dev/null && cd $APPVEYOR_BUILD_FOLDER && pwd && ls -la" - file jq.exe test_script: - bash -lc "exec 0</dev/null && cd $APPVEYOR_BUILD_FOLDER && make -j4 'TESTS=tests/mantest tests/onigtest' check" - bash -lc "exec 0</dev/null && cd $APPVEYOR_BUILD_FOLDER && make -j4 'TESTS=tests/mantest tests/jqtest tests/onigtest' check" artifacts: - path: jq-package.zip name: jq-package14 unmodified linesmodified:Makefile.am+1 added-1 removed
109 unmodified lines110 endif111 112 ### Tests (make check)113 114-TESTS = tests/mantest tests/jqtest tests/onigtest tests/shtest114+TESTS = tests/optionaltest tests/mantest tests/jqtest tests/onigtest tests/shtest115 TESTS_ENVIRONMENT = NO_VALGRIND=$(NO_VALGRIND)116 117 118 ### Building the manpage73 unmodified lines