pesticide

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

*

  • Pesticide are a package to help you to test your functions on a template
  • engine. It provides a set of test cases that you can use to test your
  • functions.
  • More pesticide for less bugs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForceTimeLocal added in v1.0.0

func ForceTimeLocal(t *testing.T, local *time.Location)

ForceTimeLocal temporarily sets time.Local for test purpose.

func RunGroupTest added in v1.0.0

func RunGroupTest(t *testing.T, rg *sprout.RegistryGroup, tc GroupTestCase)

func RunRegexpTestCases

func RunRegexpTestCases(t *testing.T, registry sprout.Registry, tcs []RegexpTestCase)

func RunTestCases

func RunTestCases(t *testing.T, registry sprout.Registry, tc []TestCase)

func TestTemplate

func TestTemplate(t *testing.T, registry sprout.Registry, tmplString string, data any) (string, error)

Types

type GroupTestCase added in v1.0.0

type GroupTestCase struct {
	RegistriesUIDs []string
}

type RegexpTestCase

type RegexpTestCase struct {
	Name     string
	Template string
	Regexp   string
	Length   int
}

type TestCase

type TestCase struct {
	Name           string
	Input          string
	Data           map[string]any
	ExpectedOutput string
	ExpectedErr    string
}

Jump to

Keyboard shortcuts

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