summaryrefslogtreecommitdiff
path: root/src/pkg/template/template_test.go
AgeCommit message (Collapse)AuthorFilesLines
2011-09-13Imported Upstream version 60Ondřej Surý1-806/+0
2011-06-30Imported Upstream version 58upstream/58Ondřej Surý1-0/+43
2011-02-18Imported Upstream version 2011.02.15upstream/2011.02.15Ondřej Surý1-51/+135
2011-02-14Imported Upstream version 2011-02-01.1upstream/2011-02-01.1Ondřej Surý1-11/+30
2011-01-17Imported Upstream version 2011.01.12upstream/2011.01.12Ondřej Surý1-110/+185
2010-04-26template: fix handling of pointer inside interfaceRuss Cox1-0/+7
R=r CC=golang-dev http://codereview.appspot.com/982043
2010-04-21json: Marshal, Unmarshal using new scannerRuss Cox1-1/+1
R=r CC=golang-dev http://codereview.appspot.com/953041
2010-03-19template: fixed html formatter bug where it would turn a []byteAndrew Gerrand1-0/+11
into a string of decimal numbers. R=r, rsc CC=golang-dev http://codereview.appspot.com/624041
2010-03-10template: add ParseFile, MustParseFile, and associated testsAndrew Gerrand1-1/+13
R=r CC=golang-dev http://codereview.appspot.com/391041
2010-03-02gofmt: experiment: align values in map composites where possibleRobert Griesemer1-1/+1
- gofmt -w src misc - looking for feedback R=rsc, r CC=golang-dev http://codereview.appspot.com/223076
2010-02-26Fix a couple of bugs referencing data values in template.Micah Stetson1-0/+13
Adds tests and fixes for two cases that fail with the current release. R=golang-dev, r CC=golang-dev http://codereview.appspot.com/217115 Committer: Rob Pike <r@golang.org>
2010-02-25strings: delete Runes, BytesRuss Cox1-2/+1
gofmt -w -r 'strings.Bytes(a) -> []byte(a)' src/cmd src/pkg test/bench gofmt -w -r 'strings.Runes(a) -> []int(a)' src/cmd src/pkg test/bench delete unused imports R=r CC=golang-dev http://codereview.appspot.com/224062
2010-02-24gofmt: don't print ()'s around function-typed results (not needed anymore)Robert Griesemer1-1/+1
- add extra test cases to go/printer tests - apply gofmt to src and misc R=rsc CC=golang-dev http://codereview.appspot.com/223041
2010-01-15template: look inside interface valuesRuss Cox1-0/+20
R=r CC=golang-dev http://codereview.appspot.com/186169
2010-01-08Rewrite tokenizer to clean up and fix a bug with spaces before delimited block.Rob Pike1-1/+23
Fixes issue 501. R=rsc CC=golang-dev http://codereview.appspot.com/181183
2009-12-24implement .repeats for maps.Rob Pike1-1/+17
Fixes issue 309. R=rsc CC=golang-dev http://codereview.appspot.com/181044
2009-12-16add the ability to invoke niladic single-valued methods in templates.Rob Pike1-0/+17
Fixes issue 389. R=rsc CC=golang-dev http://codereview.appspot.com/180061
2009-12-151) Change default gofmt default settings forRobert Griesemer1-97/+97
parsing and printing to new syntax. Use -oldparser to parse the old syntax, use -oldprinter to print the old syntax. 2) Change default gofmt formatting settings to use tabs for indentation only and to use spaces for alignment. This will make the code alignment insensitive to an editor's tabwidth. Use -spaces=false to use tabs for alignment. 3) Manually changed src/exp/parser/parser_test.go so that it doesn't try to parse the parser's source files using the old syntax (they have new syntax now). 4) gofmt -w src misc test/bench 5th and last set of files. R=rsc CC=golang-dev http://codereview.appspot.com/180050
2009-12-09remove uses of string concatenation from src and misc directoryRobert Griesemer1-72/+72
R=rsc http://codereview.appspot.com/172041
2009-11-30template: two bug fixes / nitsRuss Cox1-0/+9
* diagnose template not created with New (current code just crashes) * write []byte uninterpreted (current code writes fmt format: "[65 65 65 65]") R=r CC=golang-dev http://codereview.appspot.com/161075
2009-11-24Change to container/vector interface:Robert Griesemer1-1/+1
- removed New(len int) in favor of new(Vector).Resize(len, cap) - removed Init(len int) in favor of Resize(len, cap) - runs all.bash Fixes issue 294. R=rsc, r, r1 http://codereview.appspot.com/157143
2009-11-19Map support for template.Execute().James Meneghello1-0/+42
Allows the developer to pass a map either by itself for evaluation, or inside a struct. Access to data inside maps is identical to the current system for structs, ie. -Psuedocode- mp map[string]string = { "header" : "A fantastic header!", "footer" : "A not-so-fantastic footer!", } template.Execute(mp) ...can be accessed using {header} and {footer} in the template. Similarly, for maps inside structs: type s struct { mp map[string]string, } s1 = new s s1.mp["header"] = "A fantastic header!"; template.Execute(s1) ...is accessed using {mp.header}. Multi-maps, ie. map[string](map[string]string) and maps of structs containing more maps are unsupported, but then, I'm not even sure if that's supported by the language. Map elements can be of any type that can be written by the formatters. Keys should really only be strings. Fixes issue 259. R=r, rsc http://codereview.appspot.com/157088 Committer: Rob Pike <r@golang.org>
2009-11-09- replaced gofmt expression formatting algorithm withRobert Griesemer1-3/+3
rsc's algorithm - applied gofmt -w misc src - partial CL (last chunk) R=rsc, r http://go/go-review/1024041
2009-11-09remove semis after statements in one-statement statement listsRobert Griesemer1-19/+19
R=rsc, r http://go/go-review/1025029
2009-11-06- fine-tuning of one-line func heuristic (nodes.go)Robert Griesemer1-1/+3
- enabled for function declarations (not just function literals) - applied gofmt -w $GOROOT/src (look for instance at src/pkg/debug/elf/elf.go) R=r, rsc CC=go-dev http://go/go-review/1026006
2009-11-05gofmt-ify strings, templateRobert Griesemer1-72/+72
R=r http://go/go-review/1018064
2009-11-02fix buildRob Pike1-1/+1
R=gri http://go/go-review/1017014
2009-10-27files that are okay from the last gofmt roundRuss Cox1-3/+1
R=gri http://go/go-review/1015011
2009-10-08more lgtm files from gofmtRuss Cox1-67/+67
R=gri OCL=35485 CL=35488
2009-09-17use buf.String() instead of string(buf.Bytes())Rob Pike1-8/+8
use strings.Buffer instead of bytes.Buffer in some places R=rsc DELTA=40 (0 added, 3 deleted, 37 changed) OCL=34770 CL=34775
2009-09-17unused importsRuss Cox1-2/+0
R=r OCL=34731 CL=34731
2009-09-16rename bytes.Buffer.Data() to bytes.Buffer.Bytes()Rob Pike1-8/+8
R=rsc DELTA=152 (6 added, 0 deleted, 146 changed) OCL=34695 CL=34701
2009-09-15more "declared and not used".Russ Cox1-1/+1
the last round omitted := range and only checked 1 out of N vars in a multi-var := R=r OCL=34624 CL=34638
2009-09-01template:Russ Cox1-0/+19
* do full lookup for {.section}, so that it is always allowed to replace {Foo} with {.section Foo}{@}{.end} * treat False as empty so that .section can be used to test bools R=r DELTA=29 (21 added, 0 deleted, 8 changed) OCL=34215 CL=34219
2009-08-29Fix .alternates execution: it was skipping every second token.David Symonds1-0/+11
R=r APPROVED=r DELTA=13 (11 added, 0 deleted, 2 changed) OCL=34081 CL=34081
2009-08-26template: Support iterables for repeated fields.David Symonds1-44/+68
R=r,rsc APPROVED=rsc DELTA=194 (97 added, 32 deleted, 65 changed) OCL=33861 CL=33933
2009-08-12convert non-low-level non-google pkg codeRuss Cox1-1/+0
to whole-package compilation. R=r OCL=33070 CL=33101
2009-07-31add test of invariant in findVarRob Pike1-0/+23
R=rsc DELTA=23 (23 added, 0 deleted, 0 changed) OCL=32592 CL=32595
2009-07-30dotted namesRob Pike1-0/+11
R=rsc DELTA=28 (19 added, 0 deleted, 9 changed) OCL=32550 CL=32554
2009-06-29io.StringBytes -> strings.BytesRuss Cox1-4/+5
io.ByteBuffer -> bytes.Buffer left io.ByteBuffer stub around for now, for protocol compiler. R=r OCL=30861 CL=30872
2009-06-09mv src/lib to src/pkgRob Pike1-0/+331
tests: all.bash passes, gobuild still works, godoc still works. R=rsc OCL=30096 CL=30102