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:
1 file changed
+6
-5
+6
-5
@@ -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")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user