pesticide

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: MIT Imports: 10 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 RunMustTestCases

func RunMustTestCases(t *testing.T, registry sprout.Registry, tc []MustTestCase)

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 MustTestCase

type MustTestCase struct {
	TestCase
	ExpectedErr string
}

type RegexpTestCase

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

type TestCase

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

Jump to

Keyboard shortcuts

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