pesticide

package
v0.6.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 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 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 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