manual.yml: remove contingent tests
Also clarify non-prescriptive nature of some tests in jq.test
This commit is contained in:
1 parent
7b725378b9
commit
13fbe98dff
4 files changed
+16
-11
No files matched your search
@@ -863,8 +863,8 @@ sections:
|
||||
|
||||
examples:
|
||||
- program: 'map(abs)'
|
||||
input: '[-10, -1.1, -1e-1, 1000000000000000002, -1000000000000000002]'
|
||||
output: ['[10,1.1,1e-1,10000000000000002,1e+18]']
|
||||
input: '[-10, -1.1, -1e-1]'
|
||||
output: ['[10,1.1,1e-1]']
|
||||
|
||||
- title: "`length`"
|
||||
body: |
|
||||
|
||||
Generated
+2
-2
@@ -849,8 +849,8 @@ To compute the absolute value of a number as a floating point number, you may wi
|
||||
.nf
|
||||
|
||||
jq \'map(abs)\'
|
||||
[\-10, \-1\.1, \-1e\-1, 1000000000000000002, \-1000000000000000002]
|
||||
=> [10,1\.1,1e\-1,10000000000000002,1e+18]
|
||||
[\-10, \-1\.1, \-1e\-1]
|
||||
=> [10,1\.1,1e\-1]
|
||||
.
|
||||
.fi
|
||||
.
|
||||
|
||||
+10
-5
@@ -1814,12 +1814,17 @@ abs
|
||||
"abc"
|
||||
|
||||
map(abs)
|
||||
[-10, -1.1, -1e-1, 1000000000000000002]
|
||||
[10,1.1,0.1,1000000000000000002]
|
||||
[-0, 0, -10, -1.1]
|
||||
[0,0,10,1.1]
|
||||
|
||||
map(fabs == length) | unique[0]
|
||||
[-10, -1.1, -1e-1, 1000000000000000002, -1000000000000000002]
|
||||
true
|
||||
map(fabs == length) | unique
|
||||
[-10, -1.1, -1e-1, 1000000000000000002]
|
||||
[true]
|
||||
|
||||
# The following is NOT prescriptive:
|
||||
map(abs)
|
||||
[0.1,1000000000000000002]
|
||||
[1e-1, 1000000000000000002]
|
||||
|
||||
# Using a keyword as variable/label name
|
||||
|
||||
|
||||
Generated
+2
-2
@@ -189,8 +189,8 @@ null
|
||||
-1
|
||||
|
||||
map(abs)
|
||||
[-10, -1.1, -1e-1, 1000000000000000002, -1000000000000000002]
|
||||
[10,1.1,1e-1,10000000000000002,1e+18]
|
||||
[-10, -1.1, -1e-1]
|
||||
[10,1.1,1e-1]
|
||||
|
||||
.[] | length
|
||||
[[1,2], "string", {"a":2}, null, -5]
|
||||
|
||||
Reference in new issue
Block a user