~john-koepi/ubuntu/trusty/golang/default

« back to all changes in this revision

Viewing changes to src/pkg/text/template/exec_test.go

  • Committer: Package Import Robot
  • Author(s): Ondřej Surý
  • Date: 2012-05-02 15:44:59 UTC
  • mfrom: (14.1.12 sid)
  • Revision ID: package-import@ubuntu.com-20120502154459-wcmy8ao1325ml619
Tags: 2:1.0.1-1
* Imported Upstream version 1.0.1
* Apply godoc patch to display package list correctly (Closes: #669354)

Show diffs side-by-side

added added

removed removed

Lines of Context:
470
470
        {"bug7a", "{{3 2}}", "", tVal, false},
471
471
        {"bug7b", "{{$x := 1}}{{$x 2}}", "", tVal, false},
472
472
        {"bug7c", "{{$x := 1}}{{3 | $x}}", "", tVal, false},
 
473
        // Pipelined arg was not being type-checked.
 
474
        {"bug8a", "{{3|oneArg}}", "", tVal, false},
 
475
        {"bug8b", "{{4|dddArg 3}}", "", tVal, false},
473
476
}
474
477
 
475
478
func zeroArgs() string {
480
483
        return "oneArg=" + a
481
484
}
482
485
 
 
486
func dddArg(a int, b ...string) string {
 
487
        return fmt.Sprintln(a, b)
 
488
}
 
489
 
483
490
// count returns a channel that will deliver n sequential 1-letter strings starting at "a"
484
491
func count(n int) chan string {
485
492
        if n == 0 {
504
511
        b := new(bytes.Buffer)
505
512
        funcs := FuncMap{
506
513
                "count":    count,
 
514
                "dddArg":   dddArg,
507
515
                "oneArg":   oneArg,
508
516
                "typeOf":   typeOf,
509
517
                "vfunc":    vfunc,