Files
xgcl/tools/randomness/randomness_test.go
T
2026-05-27 23:03:00 +08:00

46 lines
705 B
Go

//go:build ignore
// +build ignore
package main
import (
"fmt"
"testing"
)
func TestLowerBound(t *testing.T) {
fmt.Println(lowerBound(1024))
}
func TestP(t *testing.T) {
tests := []string{
"Frequency",
"BlockFrequency",
"CumulativeSums",
"Runs",
"LongestRunOfOnes",
"Rank",
"DiscreteFourierTransform",
"Universal",
"ApproximateEntropy",
"LinearComplexity",
"Serial",
"Poker",
"Autocorrelation",
"BinaryDerivative",
"RunsDistribution",
}
for _, t := range tests {
fmt.Printf(`
sum = 0
for _, e := range epsilons {
if statistics.%s(e) {
sum += 1
}
}
if sum < bound {
fmt.Printf("%s Test Failed: \d/\d\n", sum, len(epsilons))
}
`, t, t)
}
}