Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,19 @@
# Test case 1:
.
1
1
# Test case 2:
1+1
null
2
# Test case 3 (with the wrong result):
1+1
null
0
# A test case with a function definition:
def factorial: if . <= 0 then 1 else . * ((. - 1) | factorial) end; factorial
3
6

View file

@ -0,0 +1,8 @@
$ jq --run-tests < jq.tests
Testing '.' at line number 3
Testing '1+1' at line number 8
Testing '1+1' at line number 13
*** Expected 0, but got 2 for test at line number 15: 1+1
Testing 'def factorial: if . <= 0 then 1 else . * ((. - 1) | factorial) end; factorial' at line number 18
3 of 4 tests passed (0 malformed)

View file

@ -0,0 +1,3 @@
def factorial: if . <= 0 then 1 else . * ((. - 1) | factorial) end;
def palindrome: explode as $in | ($in|reverse) == $in;

View file

@ -0,0 +1,7 @@
import "library" as lib; lib::factorial
3
6
import "library" as lib; lib::palindrome
"salàlas"
true

View file

@ -0,0 +1 @@
jq --run-tests < test-library.txt