MCPcopy Create free account
hub / github.com/bufbuild/buf / TestWorkspaceWithTargetingModuleCommonParentDir

Function TestWorkspaceWithTargetingModuleCommonParentDir

cmd/buf/workspace_test.go:1661–1711  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1659}
1660
1661func TestWorkspaceWithTargetingModuleCommonParentDir(t *testing.T) {
1662 workspaceDir := filepath.Join("testdata", "workspace", "success", "shared_parent_dir")
1663 requireBuildOutputFilePaths(
1664 t,
1665 map[string]expectedFileInfo{
1666 "foo.proto": {},
1667 "bar.proto": {},
1668 "baz.proto": {},
1669 "imported.proto": {},
1670 "standalone.proto": {},
1671 },
1672 workspaceDir,
1673 )
1674 requireBuildOutputFilePaths(
1675 t,
1676 map[string]expectedFileInfo{
1677 "imported.proto": {},
1678 "standalone.proto": {},
1679 },
1680 filepath.Join(workspaceDir, "standalone"),
1681 )
1682 requireBuildOutputFilePaths(
1683 t,
1684 map[string]expectedFileInfo{
1685 "foo.proto": {},
1686 "bar.proto": {},
1687 "baz.proto": {},
1688 "imported.proto": {isImport: true},
1689 },
1690 filepath.Join(workspaceDir, "parent"),
1691 )
1692 requireBuildOutputFilePaths(
1693 t,
1694 map[string]expectedFileInfo{
1695 "foo.proto": {isImport: true},
1696 "bar.proto": {},
1697 "baz.proto": {},
1698 "imported.proto": {isImport: true},
1699 },
1700 filepath.Join(workspaceDir, "parent/nextlayer"),
1701 )
1702 requireBuildOutputFilePaths(
1703 t,
1704 map[string]expectedFileInfo{
1705 "foo.proto": {isImport: true},
1706 "bar.proto": {},
1707 "imported.proto": {isImport: true},
1708 },
1709 filepath.Join(workspaceDir, "parent/nextlayer/bar"),
1710 )
1711}
1712
1713func createZipFromDir(t *testing.T, rootPath string, archiveName string) string {
1714 zipDir := filepath.Join(t.TempDir(), rootPath)

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…