Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for TestExecError (0.15 sec)

  1. src/html/template/exec_test.go

    {{define "one"}}{{template "two" .}}{{end}}
    {{define "two"}}{{template "three" .}}{{end}}
    {{define "three"}}{{index "hi" $}}{{end}}`
    
    // Check that an error from a nested template contains all the relevant information.
    func TestExecError(t *testing.T) {
    	tmpl, err := New("top").Parse(execErrorText)
    	if err != nil {
    		t.Fatal("parse error:", err)
    	}
    	var b bytes.Buffer
    	err = tmpl.Execute(&b, 5) // 5 is out of range indexing "hi"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Feb 24 21:59:12 UTC 2024
    - 57.6K bytes
    - Viewed (0)
  2. src/text/template/exec_test.go

    {{define "one"}}{{template "two" .}}{{end}}
    {{define "two"}}{{template "three" .}}{{end}}
    {{define "three"}}{{index "hi" $}}{{end}}`
    
    // Check that an error from a nested template contains all the relevant information.
    func TestExecError(t *testing.T) {
    	tmpl, err := New("top").Parse(execErrorText)
    	if err != nil {
    		t.Fatal("parse error:", err)
    	}
    	var b bytes.Buffer
    	err = tmpl.Execute(&b, 5) // 5 is out of range indexing "hi"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 24 22:23:55 UTC 2024
    - 60.1K bytes
    - Viewed (0)
Back to top