Example #1
0
func TestDivid(t *testing.T) {
	res, _ := algorithm.Divid(12, 42)
	if res == 6 {
		t.Log("OK")
	} else {
		t.Error("Can not divid this two numbers for greatest common divisor, current is:", res)
	}
}
Example #2
0
func TestDividNegativeChecking(t *testing.T) {
	_, err := algorithm.Divid(-1, 1)
	if err == nil {
		t.Error("Can not check the negative numbers")
	}
}