Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
153
int32_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
162
TEST(Match, test6)
163
{
Callers
1
TEST
Function · 0.70
Calls
2
match
Function · 0.50
expr
Function · 0.50
Tested by
no test coverage detected