Skip to content
Myr

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

5 files+38 added−17 removed

modified:tests/jq.test+7 added-15 removed
417 unmodified lines
418. as [$i] | . as $i | $i419[0]420[0]421422%%FAIL422%%FAIL IGNORE MSG423. as [] | null424jq: error: syntax error, unexpected ']', expecting '$' or '[' or '{' (Unix shell quoting issues?) at <top-level>, line 1:425426%%FAIL426%%FAIL IGNORE MSG427. as {} | null428jq: error: syntax error, unexpected '}' (Unix shell quoting issues?) at <top-level>, line 1:429430# [.,(.[] | {x:.},.),.,.[]]
612 unmodified lines
1043sort1044[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}]10461047(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.test10481049unique1050[1,2,5,3,5,3,1,3]1051[1,2,3,5]
131 unmodified lines
1183bsearch(4)1184[1,2,3]1185-411861193[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.test11881189strftime("%Y-%m-%dT%H:%M:%SZ")1190[2015,2,5,23,51,47,4,63]1191"2015-03-05T23:51:47Z"11921201strftime("%A, %B %e, %Y")1193strftime("%A, %B %d, %Y")11941435677542.8223511195"Tuesday, June 30, 2015"11961197gmtime
40 unmodified lines
1238%%FAIL IGNORE MSG1239import "syntaxerror" as e; .1240jq: error: syntax error, unexpected ';', expecting $end (Unix shell quoting issues?) at /home/nico/ws/jq/tests/modules/syntaxerror/syntaxerror.jq, line 1:12411250%%FAIL1242%%FAIL IGNORE MSG1243%::wat1244jq: error: syntax error, unexpected '%', expecting $end (Unix shell quoting issues?) at <top-level>, line 1:12451246import "test_bind_order" as check; check::check
51 unmodified lines
12981299[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)1300null13011310%%FAIL1302%%FAIL IGNORE MSG1303}1304jq: error: syntax error, unexpected INVALID_CHARACTER, expecting $end (Unix shell quoting issues?) at <top-level>, line 1:13051306(.[{}] = 0)?
3 unmodified lines
added:tests/optional.test+24 added
1# See tests/jq.test and the jq manual for more information.23# 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).56(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}]]1314# 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]1819# %e is not available on mingw/WIN3220strftime("%A, %B %e, %Y")211435677542.82235122"Tuesday, June 30, 2015"2324
added:tests/optionaltest+5 added
1#!/bin/sh23. "${0%/*}/setup"45$VALGRIND $Q $JQ -L "$mods" --run-tests $JQTESTDIR/optional.test
modified:appveyor.yml+1 added-1 removed
modified:Makefile.am+1 added-1 removed
109 unmodified lines
110endif111112### Tests (make check)113114TESTS = tests/mantest tests/jqtest tests/onigtest tests/shtest114TESTS = tests/optionaltest tests/mantest tests/jqtest tests/onigtest tests/shtest115TESTS_ENVIRONMENT = NO_VALGRIND=$(NO_VALGRIND)116117118### Building the manpage
73 unmodified lines