internal

package
v3.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package internal contains textproc internals.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckErrorChannel

func CheckErrorChannel(t *testing.T, errCh <-chan error, want error)

CheckErrorChannel checks that an error channel delivers an expected value and is then closed.

func CheckRuneChannel

func CheckRuneChannel(t *testing.T, runeCh <-chan rune, content string)

CheckRuneChannel checks the entire content of a rune channel.

func CheckRuneProcessor

func CheckRuneProcessor(t *testing.T, processor textproc.RuneProcessor,
	testcases RuneProcessorTestCases)

CheckRuneProcessor checks the RuneProcessor on the test cases.

func CheckTokenChannel

func CheckTokenChannel(t *testing.T, tokenCh <-chan []rune, strings []string)

CheckTokenChannel checks the entire content of a token channel.

func CheckTokenizer

func CheckTokenizer(t *testing.T, tokenizer textproc.Tokenizer,
	testcases TokenizerTestCases)

CheckTokenizer checks the Tokenizer on the test cases.

Types

type RuneProcessorTestCases

type RuneProcessorTestCases = map[string]*struct {
	String string
	Error  error
}

RuneProcessorTestCases maps input to corresponding output and error for a RuneProcessor.

type TokenizerTestCases

type TokenizerTestCases = map[string]*struct {
	Strings []string
	Error   error
}

TokenizerTestCases maps input to corresponding output and error for a Tokenizer.

Jump to

Keyboard shortcuts

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