46 lines
705 B
Go
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)
|
|
}
|
|
}
|