From d682175c6e9c9e6949c599476f64dd984c7c5b4f Mon Sep 17 00:00:00 2001 From: Brad Garcia Date: Thu, 30 Jan 2014 15:32:23 -0500 Subject: [PATCH] godoc: test fixes for recent cmdline changes. Tests broken by: https://code.google.com/p/go/source/detail?r=1666da2583f4&repo=tools R=gri, adonovan CC=golang-codereviews https://golang.org/cl/58780043 --- cmd/godoc/godoc_test.go | 2 +- godoc/cmdline_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/godoc/godoc_test.go b/cmd/godoc/godoc_test.go index 8988be09aa..65db45596e 100644 --- a/cmd/godoc/godoc_test.go +++ b/cmd/godoc/godoc_test.go @@ -28,8 +28,8 @@ var godocTests = []struct { { []string{"io", "WriteString"}, []string{ - `import "io"`, `func WriteString\(`, + `WriteString writes the contents of the string s to w`, }, }, } diff --git a/godoc/cmdline_test.go b/godoc/cmdline_test.go index 52c706d252..a39ef8c371 100644 --- a/godoc/cmdline_test.go +++ b/godoc/cmdline_test.go @@ -183,8 +183,8 @@ package main p.cmdHandler = handlerServer{p, c, "/cmd/", "/src/cmd"} p.pkgHandler = handlerServer{p, c, "/pkg/", "/src/pkg"} p.initFuncMap() - p.PackageText = template.Must(template.New("PackageText").Funcs(p.FuncMap()).Parse(`{{with .PAst}}{{range $filename, $ast := .}}{{$filename}}: -{{node $ $ast}}{{end}}{{end}}{{with .PDoc}}{{if $.IsMain}}COMMAND {{.Doc}}{{else}}PACKAGE {{.Doc}}{{end}}{{with .Funcs}} + p.PackageText = template.Must(template.New("PackageText").Funcs(p.FuncMap()).Parse(`{{$info := .}}{{$filtered := .IsFiltered}}{{if $filtered}}{{range .PAst}}{{range .Decls}}{{node $info .}}{{end}}{{end}}{{else}}{{with .PAst}}{{range $filename, $ast := .}}{{$filename}}: +{{node $ $ast}}{{end}}{{end}}{{end}}{{with .PDoc}}{{if $.IsMain}}COMMAND {{.Doc}}{{else}}PACKAGE {{.Doc}}{{end}}{{with .Funcs}} {{range .}}{{node $ .Decl}} {{comment_text .Doc " " "\t"}}{{end}}{{end}}{{end}}`))