mirror of
https://github.com/0xAX/go-algorithms
synced 2024-11-11 19:10:39 +00:00
19 lines
265 B
Go
19 lines
265 B
Go
|
package gcd
|
||
|
|
||
|
import "testing"
|
||
|
|
||
|
func Test_gcd(t *testing.T) {
|
||
|
|
||
|
if gcd(100, 200) != 50 {
|
||
|
t.Error("[Error] gcd(100, 200) is wrong")
|
||
|
}
|
||
|
|
||
|
if gcd(4, 2) != 1 {
|
||
|
t.Error("[Error] gcd(4,2) is wrong")
|
||
|
}
|
||
|
|
||
|
if gcd(6, 3) != 3 {
|
||
|
t.Error("[Error] gcd(6,3) is wrong")
|
||
|
}
|
||
|
}
|