package entropy

import (
	"testing"
)

func TestMarkovSimple(t *testing.T) {
	data := []byte{0b10001110, 0b01010101, 0b11001100, 0b01110010, 0b10101110}
	h := MarkovTests(data, false)
	if h-0.761 > 0.01 {
		t.Fatal()
	}
}

func TestMarkov(t *testing.T) {
	// 系统熵源
	// entropy := OSEntropySource{}
	entropy := SysTimeEntropySource{}
	data, _ := entropy.GetEntropy(1000000/8, 1000000/8, 1000000/8)
	MarkovTests(data, false)
}

func TestEntropyPoll(t *testing.T) {
	pool := &EntropyPool{}
	for i := 0; i < 100; i++ {
		pool.lshr(0)
	}
}
