Sign in
chromium
/
external
/
github.com
/
google
/
starlark-go
/
169c9869398d879b05dcd91a2454986390557652
/
.
/
starlark
/
testdata
/
recursion.star
blob: 7029ea0582ddeb665a7caa624c77b22646c959e3 [
file
] [
log
] [
blame
]
# Tests of Starlark recursion and while statement.
# This is a "chunked" file: each "---" effectively starts a new file.
# option:recursion
load
(
"assert.star"
,
"assert"
)
def
fib
(
n
):
if
n
<=
1
:
return
1
return
fib
(
n
-
1
)
+
fib
(
n
-
2
)
assert
.
eq
(
fib
(
5
),
8
)