testtext

package
v0.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

README

Package cloudeng.io/text/testing/testtext

CircleCI Go Report Card

import cloudeng.io/text/testing/testtext

Types

Type Option
type Option func(o *options)

Option represents an option to the factory methods in this package.

Functions
func IncludeControlOpt(v bool) Option

IncludeControlOpt controls whether control characters can be included in the generated strings.

Type Random
type Random struct {
	// contains filtered or unexported fields
}

Random can be used to generate strings containing randomly selected runes.

Functions
func NewRandom(opts ...Option) *Random

NewRandom returns a new instance of Random.

Methods
func (r Random) AllRuneLens(nRunes int) string

AllRuneLens generates a string of length nRunes that contains runes of differing lengths. The lengths used are a randomized but repeating order of 1..4.

func (r Random) WithRuneLen(nBytes int, nRunes int) string

RuneLen generates a string of length nRunes that contains only the requested number of nBytes (1-4) per rune.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(o *options)

Option represents an option to the factory methods in this package.

func IncludeControlOpt

func IncludeControlOpt(v bool) Option

IncludeControlOpt controls whether control characters can be included in the generated strings.

type Random

type Random struct {
	// contains filtered or unexported fields
}

Random can be used to generate strings containing randomly selected runes.

func NewRandom

func NewRandom(opts ...Option) *Random

NewRandom returns a new instance of Random.

func (Random) AllRuneLens

func (r Random) AllRuneLens(nRunes int) string

AllRuneLens generates a string of length nRunes that contains runes of differing lengths. The lengths used are a randomized but repeating order of 1..4.

func (Random) WithRuneLen

func (r Random) WithRuneLen(nBytes int, nRunes int) string

RuneLen generates a string of length nRunes that contains only the requested number of nBytes (1-4) per rune.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL