MCPcopy Create free account
hub / github.com/BowenFu/matchit.cpp / fib

Function fib

test/matchit/legacy.cpp:153–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151}
152
153int32_t fib(int32_t n)
154{
155 EXPECT_TRUE(n > 0);
156 return match(n)(
157 pattern | 1 = expr(1), pattern | 2 = expr(1),
158 pattern | _ = [n]
159 { return fib(n - 1) + fib(n - 2); });
160}
161
162TEST(Match, test6)
163{

Callers 1

TESTFunction · 0.70

Calls 2

matchFunction · 0.50
exprFunction · 0.50

Tested by

no test coverage detected