aboutsummaryrefslogtreecommitdiff
path: root/internal/testing/sample/sample.go
diff options
context:
space:
mode:
authorJulie Qiu <julie@golang.org>2021-06-21 22:14:47 -0700
committerJulie Qiu <julie@golang.org>2021-07-13 16:25:53 +0000
commit01e3e3198312fe6a30cf012b4d06bee6872f7ef8 (patch)
tree9c428b93e79c66f32ce60359c5af017d22c38392 /internal/testing/sample/sample.go
parentdc9c142d58befdeecd17ab5e34326c49059e2ed0 (diff)
downloadgo-x-pkgsite-01e3e3198312fe6a30cf012b4d06bee6872f7ef8.tar.xz
internal/postgres: change upsertSymbolSearchDocuments query
The upsertSymbolSearchDocuments query is changed to filter on module path and version, instead of passing an array of unit_ids. Additional tests are added to TestSymbolSearch. For golang/go#44142 Change-Id: Ic0c493711c2c8fcc32e207ea466c509e6f99209b Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/329924 Trust: Julie Qiu <julie@golang.org> Run-TryBot: Julie Qiu <julie@golang.org> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
Diffstat (limited to 'internal/testing/sample/sample.go')
-rw-r--r--internal/testing/sample/sample.go50
1 files changed, 21 insertions, 29 deletions
diff --git a/internal/testing/sample/sample.go b/internal/testing/sample/sample.go
index 2df0819b..27fdad11 100644
--- a/internal/testing/sample/sample.go
+++ b/internal/testing/sample/sample.go
@@ -53,17 +53,10 @@ var (
GOARCH = internal.All
Doc = Documentation(GOOS, GOARCH, DocContents)
API = []*internal.Symbol{
- {
- SymbolMeta: internal.SymbolMeta{
- Name: "V",
- ParentName: "V",
- Synopsis: "var V int",
- Section: internal.SymbolSectionVariables,
- Kind: internal.SymbolKindVariable,
- },
- GOOS: GOOS,
- GOARCH: GOARCH,
- },
+ Constant,
+ Variable,
+ Function,
+ Type,
}
DocContents = `
// Package p is a package.
@@ -126,26 +119,25 @@ var (
GOOS: internal.All,
GOARCH: internal.All,
Children: []*internal.SymbolMeta{
- func() *internal.SymbolMeta {
- n := FunctionNew.SymbolMeta
- return &n
- }(),
- {
- Name: "Type.Field",
- Synopsis: "field",
- Section: internal.SymbolSectionTypes,
- Kind: internal.SymbolKindField,
- ParentName: "Type",
- },
- {
- Name: "Type.Method",
- Synopsis: "method",
- Section: internal.SymbolSectionTypes,
- Kind: internal.SymbolKindMethod,
- ParentName: "Type",
- },
+ &FunctionNew.SymbolMeta,
+ &Field,
+ &Method,
},
}
+ Field = internal.SymbolMeta{
+ Name: "Type.Field",
+ Synopsis: "field",
+ Section: internal.SymbolSectionTypes,
+ Kind: internal.SymbolKindField,
+ ParentName: "Type",
+ }
+ Method = internal.SymbolMeta{
+ Name: "Type.Method",
+ Synopsis: "method",
+ Section: internal.SymbolSectionTypes,
+ Kind: internal.SymbolKindMethod,
+ ParentName: "Type",
+ }
)
// LicenseCmpOpts are options to use when comparing licenses with the cmp package.