1
0
mirror of https://github.com/stedolan/jq.git synced 2024-05-11 05:55:39 +00:00

86 Commits

Author SHA1 Message Date
088a42fc53 Allow multiple functions with different arities 2014-06-16 00:05:30 -05:00
46436bd870 Add test of indices with short input 2014-06-08 02:27:27 -05:00
1dbe9317bc Add indices(s), improve index(s), rindex(s)
Now these deal with arrays as input and `s` being an array or a scalar.
2014-06-08 02:01:44 -05:00
74d2216da2 Test arrays and friend filters 2014-03-13 00:29:53 -05:00
4402c6d806 One more recursive merge test 2014-03-12 23:44:21 -05:00
2aa8a43c5b Add a recursive object merge strategy and bind it to *
This commit adds a jv_object_merge_recursive function, that performs
recursive object merging, and binds it to multiply when applied to
two objects.

Added docs and tests.

Closes #320
2014-03-08 03:56:05 +01:00
219bb9ecb7 Make libm tests more portable 2014-03-06 21:38:10 -06:00
59302fd208 Add missing trig functions and barebones test 2014-02-21 10:49:21 -06:00
fe29d3d3fa Add ?, .[]?, and .. operators
Make XPath-like `//a/b` recursive structure traversal easier in jq,
which then becomes:

    ..|.a?.b?

The `?` operator suppresses errors about . not being an array or object.
The `..` operator is equivalent to calling the new `recurse_down`
built-in, which in turn is equivalent to

    recurse(.[]?)

Note that `..a` is not supported; neither is `...a`.  That could be add
added, but it doesn't seem worth the trouble of saving the need to type
a '|'.
2014-02-20 15:33:07 -06:00
1fa55a3fae Fix cut-n-paste in leaf_paths; doc and test 'em 2014-02-05 23:14:05 -06:00
18e828f17c Allow negated object values without parens. Fixes #247 2013-12-17 22:28:31 +00:00
32ea50d336 Make the testsuite run on machines without valgrind 2013-12-13 15:22:17 +00:00
f147b7fae5 Merge pull request #239 from DRMacIver/overflows
Avoid undefined behaviour with large array indices
2013-12-12 16:38:14 -08:00
474386a1d9 Complete more-arity feature not complete
And test
2013-12-11 14:14:26 -06:00
5412f3f1c1 convert range bounds to integers in a way that avoids undefined behaviour 2013-12-10 09:20:13 +00:00
014b45b4a9 add checking of numeric indices to an array to see if they can reasonably be considered integers. Avoid undefined behaviour if out of bounds 2013-12-10 09:20:12 +00:00
426edff09c Add tests for string index by string and builtins 2013-12-04 18:21:42 -06:00
9fa2173825 Test ltrimstr and rtrimstr functions 2013-12-04 18:21:41 -06:00
3c4248192d Test tojson and fromjson 2013-12-04 18:21:40 -06:00
da129f6664 Test string slicing 2013-12-04 18:21:39 -06:00
5aadaa79eb Add tests for string division/splitting 2013-12-04 18:21:39 -06:00
63bed9bdf1 Test starts/endswith and string multiplication 2013-12-04 18:21:39 -06:00
a0b942a7f5 Add a few more test cases (from the man page)
Signed-off-by: Nicolas Williams <nico@cryptonector.com>
2013-11-30 00:55:26 -06:00
8d4748c8df Fix a crash on group_by of empty list. Fixes #208. 2013-11-07 12:18:48 +00:00
c427bf6a94 Add test showing calculation of standard deviation 2013-09-14 17:48:19 -04:00
82d8253c19 Add sqrt operator 2013-09-11 20:24:41 -04:00
7c4171d414 Add floor operator 2013-06-21 15:27:34 -05:00
3403d07912 Add mod (and setmod) operators 2013-06-21 15:27:34 -05:00
81e2336ace Support ."foo" syntax for accessing fields. See #141. 2013-06-11 22:26:39 +01:00
bc42812715 Remove the insane "fold" operation, replace with saner "reduce". 2013-05-16 15:07:53 +01:00
e83e51eb56 'length' function now measures string length in codepoints, not bytes. 2013-05-15 00:37:38 +01:00
c496a924ce Bugfix for array slices. 2013-05-15 00:22:44 +01:00
33901b74b1 Array slicing. Closes #2. 2013-05-13 20:16:19 +01:00
d8706fd460 Fix the //= operator.
Closes #62.
2013-05-13 16:04:30 +01:00
e29db8d272 Fix bug with path handling (used in assignments).
Closes #67
2013-05-11 18:10:21 +01:00
d121420757 Clean up autotools config.
Remove some of @stagrlee's hard work since jq's testsuite is
less silly than when he wrote the autotools config.
2013-05-08 02:42:23 +01:00