github.com/qioalice/ekago/v3@v3.3.2-0.20221202205325-5c262d586ee4/ekarand/randstrgen_test.go (about) 1 // Copyright © 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 ekarand_test 7 8 import ( 9 "fmt" 10 "testing" 11 12 "github.com/stretchr/testify/assert" 13 14 "github.com/qioalice/ekago/v3/ekarand" 15 ) 16 17 func doTest(t *testing.T, n int) { 18 str := ekarand.WithLen(n) 19 assert.Len(t, str, n) 20 fmt.Println(str) 21 } 22 23 func TestWithLen(t *testing.T) { 24 doTest(t, 10) 25 doTest(t, 10) 26 doTest(t, 10) 27 doTest(t, 10) 28 doTest(t, 10) 29 doTest(t, 10) 30 }