21 lines
369 B
Go
21 lines
369 B
Go
|
package lua_speed
|
||
|
|
||
|
import (
|
||
|
"github.com/negrel/assert"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestFibonacciLua(t *testing.T) {
|
||
|
L := FibonacciLuaInit()
|
||
|
for _, i := range fibonacciNumbers {
|
||
|
assert.Equal(i[0], FibonacciLuaRun(L, i[1]))
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func BenchmarkFibonacciLuaRun(b *testing.B) {
|
||
|
L := FibonacciLuaInit()
|
||
|
for i := 0; i < b.N; i++ {
|
||
|
_ = FibonacciLuaRun(L, 83)
|
||
|
}
|
||
|
}
|