Merge pull request #30 from juliovcruz/master

Add tests to Fibonacci function
pull/35/head
0xAX 4 years ago committed by GitHub
commit bb4e627657
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,19 @@
package numerical
import "testing"
func TestFibonacci(t *testing.T) {
if fibo(10) != 55 {
t.Error("[Error] Fibonacci(10) is wrong")
}
if fibo(0) != 0 {
t.Error("[Error] Fibonacci(0) is wrong")
}
if fibo(3) != 2 {
t.Error("[Error] Fibonacci(3) is wrong")
}
}
Loading…
Cancel
Save