go/src/text/template/exec_test.go

var debug

type T

type S

func (S) Method0() string {}

type U

type V

func (v *V) String() string {}

type W

func (w *W) Error() string {}

var siVal

var tVal

var tSliceOfNil

type I

var iVal

// Helpers for creation.
func newInt(n int) *int {}

func newString(s string) *string {}

func newIntSlice(n ...int) *[]int {}

// Simple methods with and without arguments.
func (t *T) Method0() string {}

func (t *T) Method1(a int) int {}

func (t *T) Method2(a uint16, b string) string {}

func (t *T) Method3(v any) string {}

func (t *T) Copy() *T {}

func (t *T) MAdd(a int, b []int) []int {}

var myError

// MyError returns a value and an error according to its argument.
func (t *T) MyError(error bool) (bool, error) {}

// A few methods to test chaining.
func (t *T) GetU() *U {}

func (u *U) TrueFalse(b bool) string {}

func typeOf(arg any) string {}

type execTest

var bigInt

var bigUint

var execTests

func fVal1(i int) iter.Seq[int] {}

func fVal2(i int) iter.Seq2[int, int] {}

const rangeTestInt

func rangeTestData[T int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 | uintptr]() string {}

func zeroArgs() string {}

func oneArg(a string) string {}

func twoArgs(a, b string) string {}

func dddArg(a int, b ...string) string {}

// count returns a channel that will deliver n sequential 1-letter strings starting at "a"
func count(n int) chan string {}

// vfunc takes a *V and a V
func vfunc(V, *V) string {}

// valueString takes a string, not a pointer.
func valueString(v string) string {}

// returnInt returns an int
func returnInt() int {}

func add(args ...int) int {}

func echo(arg any) any {}

func makemap(arg ...string) map[string]string {}

func stringer(s fmt.Stringer) string {}

func mapOfThree() any {}

func testExecute(execTests []execTest, template *Template, t *testing.T) {}

func TestExecute(t *testing.T) {}

var delimPairs

func TestDelims(t *testing.T) {}

// Check that an error from a method flows back to the top.
func TestExecuteError(t *testing.T) {}

const execErrorText

// Check that an error from a nested template contains all the relevant information.
func TestExecError(t *testing.T) {}

type CustomError

func (*CustomError) Error() string {}

// Check that a custom error can be returned.
func TestExecError_CustomError(t *testing.T) {}

func TestJSEscaping(t *testing.T) {}

type Tree

const treeTemplate

func TestTree(t *testing.T) {}

func TestExecuteOnNewTemplate(t *testing.T) {}

const testTemplates

func TestMessageForExecuteEmpty(t *testing.T) {}

func TestFinalForPrintf(t *testing.T) {}

type cmpTest

var cmpTests

func TestComparison(t *testing.T) {}

func TestMissingMapKey(t *testing.T) {}

// Test that the error message for multiline unterminated string
// refers to the line number of the opening quote.
func TestUnterminatedStringError(t *testing.T) {}

const alwaysErrorText

var alwaysError

type ErrorWriter

func (e ErrorWriter) Write(p []byte) (int, error) {}

func TestExecuteGivesExecError(t *testing.T) {}

func funcNameTestFunc() int {}

func TestGoodFuncNames(t *testing.T) {}

func TestBadFuncNames(t *testing.T) {}

func testBadFuncName(name string, t *testing.T) {}

func TestBlock(t *testing.T) {}

func TestEvalFieldErrors(t *testing.T) {}

func TestMaxExecDepth(t *testing.T) {}

func TestAddrOfIndex(t *testing.T) {}

func TestInterfaceValues(t *testing.T) {}

// Check that panics during calls are recovered and returned as errors.
func TestExecutePanicDuringCall(t *testing.T) {}

func TestFunctionCheckDuringCall(t *testing.T) {}

// Issue 31810. Check that a parenthesized first argument behaves properly.
func TestIssue31810(t *testing.T) {}

// Issue 43065, range over send only channel
func TestIssue43065(t *testing.T) {}

// Issue 39807: data race in html/template & text/template
func TestIssue39807(t *testing.T) {}

// Issue 48215: embedded nil pointer causes panic.
// Fixed by adding FieldByIndexErr to the reflect package.
func TestIssue48215(t *testing.T) {}