gotools/go/packages/packages_test.go

var testCtx

func TestMain(m *testing.M) {}

func skipIfShort(t *testing.T, reason string) {}

// testAllOrModulesParallel tests f, in parallel, against all packagestest
// exporters in long mode, but only against the Modules exporter in short mode.
func testAllOrModulesParallel(t *testing.T, f func(*testing.T, packagestest.Exporter)) {}

// The zero-value of Config has LoadFiles mode.
func TestLoadZeroConfig(t *testing.T) {}

func TestLoadImportsGraph(t *testing.T) {}

func testLoadImportsGraph(t *testing.T, exporter packagestest.Exporter) {}

func TestLoadImportsTestVariants(t *testing.T) {}

func testLoadImportsTestVariants(t *testing.T, exporter packagestest.Exporter) {}

func TestLoadAbsolutePath(t *testing.T) {}

func TestLoadArgumentListIsNotTooLong(t *testing.T) {}

func TestVendorImports(t *testing.T) {}

func imports(p *packages.Package) []string {}

func TestConfigDir(t *testing.T) {}

func testConfigDir(t *testing.T, exporter packagestest.Exporter) {}

func TestConfigFlags(t *testing.T) {}

func testConfigFlags(t *testing.T, exporter packagestest.Exporter) {}

func TestLoadTypes(t *testing.T) {}

func testLoadTypes(t *testing.T, exporter packagestest.Exporter) {}

// TestLoadTypesBits is equivalent to TestLoadTypes except that it only requests
// the types using the NeedTypes bit.
func TestLoadTypesBits(t *testing.T) {}

func testLoadTypesBits(t *testing.T, exporter packagestest.Exporter) {}

func TestLoadSyntaxOK(t *testing.T) {}

func testLoadSyntaxOK(t *testing.T, exporter packagestest.Exporter) {}

func TestLoadDiamondTypes(t *testing.T) {}

func testLoadDiamondTypes(t *testing.T, exporter packagestest.Exporter) {}

func TestLoadSyntaxError(t *testing.T) {}

func testLoadSyntaxError(t *testing.T, exporter packagestest.Exporter) {}

// This function tests use of the ParseFile hook to modify
// the AST after parsing.
func TestParseFileModifyAST(t *testing.T) {}

func testParseFileModifyAST(t *testing.T, exporter packagestest.Exporter) {}

func TestAdHocPackagesBadImport(t *testing.T) {}

func TestLoadAllSyntaxImportErrors(t *testing.T) {}

func testLoadAllSyntaxImportErrors(t *testing.T, exporter packagestest.Exporter) {}

func TestAbsoluteFilenames(t *testing.T) {}

func testAbsoluteFilenames(t *testing.T, exporter packagestest.Exporter) {}

func TestContains(t *testing.T) {}

func testContains(t *testing.T, exporter packagestest.Exporter) {}

// This test ensures that the effective GOARCH variable in the
// application determines the Sizes function used by the type checker.
// This behavior is a stop-gap until we make the build system's query
// tool report the correct sizes function for the actual configuration.
func TestSizes(t *testing.T) {}

func testSizes(t *testing.T, exporter packagestest.Exporter) {}

// This is a regression test for a bug related to
// github.com/golang/vscode-go/issues/3021: if types are needed (any
// of NeedTypes{,Info,Sizes} and the types.Sizes cannot be obtained
// (e.g. due to a bad GOARCH) then the Load operation must fail. It
// must not return a nil TypesSizes, or use the default (wrong) size.
// (The root cause of that issue turned out to be due to skew in the
// Bazel GOPACKAGESDRIVER; see CL 537876.)
//
// We use a file=... query because it suppresses the bad-GOARCH check
// that the go command would otherwise perform eagerly.
// (Gopls relies on this as a fallback.)
func TestNeedTypeSizesWithBadGOARCH(t *testing.T) {}

// TestContainsFallbackSticks ensures that when there are both contains and non-contains queries
// the decision whether to fallback to the pre-1.11 go list sticks across both sets of calls to
// go list.
func TestContainsFallbackSticks(t *testing.T) {}

func testContainsFallbackSticks(t *testing.T, exporter packagestest.Exporter) {}

// Test that Load with no patterns is equivalent to loading "." via the golist
// driver.
func TestNoPatterns(t *testing.T) {}

func testNoPatterns(t *testing.T, exporter packagestest.Exporter) {}

func TestJSON(t *testing.T) {}

func testJSON(t *testing.T, exporter packagestest.Exporter) {}

func TestRejectInvalidQueries(t *testing.T) {}

func TestPatternPassthrough(t *testing.T) {}

func testPatternPassthrough(t *testing.T, exporter packagestest.Exporter) {}

func TestConfigDefaultEnv(t *testing.T) {}

func testConfigDefaultEnv(t *testing.T, exporter packagestest.Exporter) {}

// This test that a simple x test package layout loads correctly.
// There was a bug in go list where it returned multiple copies of the same
// package (specifically in this case of golang.org/fake/a), and this triggered
// a bug in go/packages where it would leave an empty entry in the root package
// list. This would then cause a nil pointer crash.
// This bug was triggered by the simple package layout below, and thus this
// test will make sure the bug remains fixed.
func TestBasicXTest(t *testing.T) {}

func testBasicXTest(t *testing.T, exporter packagestest.Exporter) {}

func TestErrorMissingFile(t *testing.T) {}

func testErrorMissingFile(t *testing.T, exporter packagestest.Exporter) {}

func TestReturnErrorWhenUsingNonGoFiles(t *testing.T) {}

func testReturnErrorWhenUsingNonGoFiles(t *testing.T, exporter packagestest.Exporter) {}

func TestReturnErrorWhenUsingGoFilesInMultipleDirectories(t *testing.T) {}

func testReturnErrorWhenUsingGoFilesInMultipleDirectories(t *testing.T, exporter packagestest.Exporter) {}

func TestReturnErrorForUnexpectedDirectoryLayout(t *testing.T) {}

func testReturnErrorForUnexpectedDirectoryLayout(t *testing.T, exporter packagestest.Exporter) {}

func TestMissingDependency(t *testing.T) {}

func testMissingDependency(t *testing.T, exporter packagestest.Exporter) {}

func TestAdHocContains(t *testing.T) {}

func testAdHocContains(t *testing.T, exporter packagestest.Exporter) {}

func TestCgoNoCcompiler(t *testing.T) {}

func testCgoNoCcompiler(t *testing.T, exporter packagestest.Exporter) {}

func TestCgoMissingFile(t *testing.T) {}

func testCgoMissingFile(t *testing.T, exporter packagestest.Exporter) {}

func TestLoadImportsC(t *testing.T) {}

func TestCgoNoSyntax(t *testing.T) {}

func testCgoNoSyntax(t *testing.T, exporter packagestest.Exporter) {}

func TestCgoBadPkgConfig(t *testing.T) {}

func testCgoBadPkgConfig(t *testing.T, exporter packagestest.Exporter) {}

func buildFakePkgconfig(t *testing.T, env []string) string {}

func TestIssue32814(t *testing.T) {}

func testIssue32814(t *testing.T, exporter packagestest.Exporter) {}

func TestLoadTypesInfoWithoutNeedDeps(t *testing.T) {}

func testLoadTypesInfoWithoutNeedDeps(t *testing.T, exporter packagestest.Exporter) {}

func TestLoadWithNeedDeps(t *testing.T) {}

func testLoadWithNeedDeps(t *testing.T, exporter packagestest.Exporter) {}

func TestImpliedLoadMode(t *testing.T) {}

func testImpliedLoadMode(t *testing.T, exporter packagestest.Exporter) {}

func TestIssue35331(t *testing.T) {}

func testIssue35331(t *testing.T, exporter packagestest.Exporter) {}

func TestMultiplePackageVersionsIssue36188(t *testing.T) {}

func testMultiplePackageVersionsIssue36188(t *testing.T, exporter packagestest.Exporter) {}

func TestLoadModeStrings(t *testing.T) {}

func TestCycleImportStack(t *testing.T) {}

func testCycleImportStack(t *testing.T, exporter packagestest.Exporter) {}

func TestForTestField(t *testing.T) {}

func testForTestField(t *testing.T, exporter packagestest.Exporter) {}

func TestIssue37629(t *testing.T) {}

func testIssue37629(t *testing.T, exporter packagestest.Exporter) {}

func TestIssue37098(t *testing.T) {}

func testIssue37098(t *testing.T, exporter packagestest.Exporter) {}

// TestIssue56632 checks that CompiledGoFiles does not contain non-go files regardless of
// whether the NeedFiles mode bit is set.
func TestIssue56632(t *testing.T) {}

// TestInvalidFilesInXTest checks the fix for golang/go#37971 in Go 1.15.
func TestInvalidFilesInXTest(t *testing.T) {}

func testInvalidFilesInXTest(t *testing.T, exporter packagestest.Exporter) {}

func TestTypecheckCgo(t *testing.T) {}

func testTypecheckCgo(t *testing.T, exporter packagestest.Exporter) {}

// TestIssue48226 ensures that when NeedSyntax is provided we do not nullify the
// Fset, which is needed to resolve the syntax tree element positions to files.
func TestIssue48226(t *testing.T) {}

func testIssue48226(t *testing.T, exporter packagestest.Exporter) {}

func TestModule(t *testing.T) {}

func testModule(t *testing.T, exporter packagestest.Exporter) {}

func TestExternal_NotHandled(t *testing.T) {}

func testExternal_NotHandled(t *testing.T, exporter packagestest.Exporter) {}

func TestInvalidPackageName(t *testing.T) {}

func testInvalidPackageName(t *testing.T, exporter packagestest.Exporter) {}

func TestEmptyEnvironment(t *testing.T) {}

func TestPackageLoadSingleFile(t *testing.T) {}

func errorMessages(errors []packages.Error) []string {}

func srcs(p *packages.Package) []string {}

// cleanPaths attempts to reduce path names to stable forms
func cleanPaths(paths []string) []string {}

// importGraph returns the import graph as a user-friendly string,
// and a map containing all packages keyed by ID.
func importGraph(initial []*packages.Package) (string, map[string]*packages.Package) {}

func constant(p *packages.Package, name string) *types.Const {}

func copyAll(srcPath, dstPath string) error {}

func TestExportFile(t *testing.T) {}

// TestLoadEitherSucceedsOrFails is an attempt to reproduce a sporadic
// failure observed on the Android emu builders in which Load would
// return an empty list of packages but no error. We don't expect
// packages.Load to succeed on that platform, and testenv.NeedsGoBuild
// would ordinarily suppress the attempt if called early. But
// regardless of whether the 'go' command is functional, Load should
// never return an empty set of packages but no error.
func TestLoadEitherSucceedsOrFails(t *testing.T) {}

// TestLoadOverlayGoMod ensures that overlays containing go.mod files
// are effective for all 'go list' calls made by go/packages (#67644).
func TestLoadOverlayGoMod(t *testing.T) {}

func overlayFS(overlay map[string][]byte) fstest.MapFS {}

// TestIssue69606a tests when tools in $GOROOT/pkg/tool/$GOOS_$GOARCH are missing,
// Load should return an error.
func TestIssue69606a(t *testing.T) {}

// TestIssue69606b tests when loading std from a fake goroot without a unsafe package,
// Load should return an error.
func TestIssue69606b(t *testing.T) {}