RC-1
release-tag / release-image (push) Failing after 1m18s

This commit is contained in:
2026-08-10 05:48:55 +02:00
parent 4f0ac14c49
commit 005fd6ca51
52 changed files with 9020 additions and 1 deletions
+29
View File
@@ -0,0 +1,29 @@
package core
import (
"math/big"
"testing"
)
func TestExpectedGuessDeterministic(t *testing.T) {
a := ExpectedGuess("task_x", "seed", "client", 7, 28)
b := ExpectedGuess("task_x", "seed", "client", 7, 28)
if a != b {
t.Fatalf("not deterministic: %s != %s", a, b)
}
n, ok := new(big.Int).SetString(a, 10)
if !ok || n.Sign() < 0 || n.BitLen() > 28 {
t.Fatalf("guess outside range: %s", a)
}
}
func TestScore(t *testing.T) {
if Score(big.NewInt(0), 32) != 100 {
t.Fatal("exact hit must score 100")
}
near := Score(big.NewInt(1), 32)
far := Score(new(big.Int).Lsh(big.NewInt(1), 30), 32)
if near <= far {
t.Fatalf("near score %f should exceed far %f", near, far)
}
}