Fixed test for LCM

The LCM test was expecting GCD result and because assertion was flipped (missing negation), the test was passing.
This commit is contained in:
Piotr Dyraga committed 2018-05-23 18:37:15 +02:00
1 parent 06a4b756bb
commit 622644f19d
1 file changed
+6 -5
+6 -5
View File
@@ -8,10 +8,11 @@ import (
) )
func TestLCM(t *testing.T) { func TestLCM(t *testing.T) {
a := big.NewInt(2 * 3 * 3 * 3 * 5 * 5) a := big.NewInt(1350)
b := big.NewInt(3 * 3 * 5 * 5 * 57 * 11) b := big.NewInt(141075)
exp := big.NewInt(3 * 3 * 5 * 5) expected := big.NewInt(282150)
if reflect.DeepEqual(exp, LCM(a, b)) {
if !reflect.DeepEqual(expected, LCM(a, b)) {
t.Fail() t.Fail()
} }
} }
@@ -35,7 +36,7 @@ func TestComputeMu(t *testing.T) {
exp := big.NewInt(3) exp := big.NewInt(3)
if !reflect.DeepEqual(computeMu(g, lambda, n), exp) { if !reflect.DeepEqual(computeMu(g, lambda, n), exp) {
t.Error("lambda is not well computed") t.Error("mu is not well computed")
} }
} }