RosettaCodeData/Task/Test-a-function/Jq/test-a-function-1.jq
2023-07-01 13:44:08 -04:00

19 lines
224 B
Text

# 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