github.com/qioalice/ekago/v3@v3.3.2-0.20221202205325-5c262d586ee4/ekarand/ekahaiku/haiku_test.go (about)

     1  // Copyright © 2020-2021. All rights reserved.
     2  // Author: Ilya Stroy.
     3  // Contacts: iyuryevich@pm.me, https://github.com/qioalice
     4  // License: https://opensource.org/licenses/MIT
     5  
     6  package ekahaiku_test
     7  
     8  import (
     9  	"fmt"
    10  	"testing"
    11  
    12  	"github.com/qioalice/ekago/v3/ekarand/ekahaiku"
    13  )
    14  
    15  func TestHaikunate(t *testing.T) {
    16  	fmt.Println(ekahaiku.HaikunateWithRange(100, 200))
    17  	fmt.Println(ekahaiku.HaikunateWithRange(200, 500))
    18  	fmt.Println(ekahaiku.HaikunateWithRange(30, 10))
    19  	fmt.Println(ekahaiku.Haikunate())
    20  	fmt.Println(ekahaiku.Haikunate())
    21  	fmt.Println(ekahaiku.Haikunate())
    22  	fmt.Println(ekahaiku.Haikunate())
    23  }
    24  
    25  func BenchmarkHaikunate(b *testing.B) {
    26  	b.ReportAllocs()
    27  	for i := 0; i < b.N; i++ {
    28  		_ = ekahaiku.Haikunate()
    29  	}
    30  }