Documentation
¶
Overview ¶
Package testsupport holds the helpers the tests of several packages share. Only _test.go files import it.
Index ¶
Constants ¶
const MinimalInlineOrigins = "origins:\n all: {hosts: [localhost], origins: [\"http://localhost:3000\"]}\n"
MinimalInlineOrigins is the origins block of examples/minimal/gateway.yaml. The tests that need the file form, which no example writes, replace it with "origins: <file>".
const PartialMethods = "rpc:\n methods:\n" +
" - {service: example.backend.v1.ReportService, method: ListReports, action: read, reports: [export, share]}\n"
PartialMethods is the rpc.methods block that, appended to examples/partial/gateway.yaml, writes in the proxyfile what examples/partial/methods.json lists, so a render that reads it must give that example's committed files.
Variables ¶
This section is empty.
Functions ¶
func ProblemStrings ¶
ProblemStrings returns each problem as the text a user reads, so a test compares problems with literal lines.
func ProblemStringsIn ¶
ProblemStringsIn is ProblemStrings with dir taken off the front of each line, so a row names a file written to a temporary directory by its base name alone. A line naming a file elsewhere is kept whole.
Types ¶
type Document ¶
type Document []string
Document is a valid file kept one line per item, so that each test row changes it by line number and the row's expected positions can be counted from the change alone.