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

Function TestWorkspaceOverlappingModuleDirPaths

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

Source from the content-addressed store, hash-verified

1202}
1203
1204func TestWorkspaceOverlappingModuleDirPaths(t *testing.T) {
1205 t.Parallel()
1206 workspaceDir := filepath.Join("testdata", "workspace", "success", "overlapping_dir_path")
1207 requireBuildOutputFilePaths(
1208 t,
1209 map[string]expectedFileInfo{
1210 "foo/foo.proto": {moduleFullName: "buf.test/acme/foobar"},
1211 "bar/bar.proto": {moduleFullName: "buf.test/acme/foobar"},
1212 "foo_internal.proto": {},
1213 "bar_internal.proto": {},
1214 },
1215 workspaceDir,
1216 )
1217 requireBuildOutputFilePaths(
1218 t,
1219 map[string]expectedFileInfo{
1220 "foo_internal.proto": {},
1221 },
1222 workspaceDir,
1223 "--path",
1224 filepath.Join(workspaceDir, "proto", "foo", "internal", "foo_internal.proto"),
1225 )
1226 requireBuildOutputFilePaths(
1227 t,
1228 map[string]expectedFileInfo{
1229 "foo/foo.proto": {moduleFullName: "buf.test/acme/foobar"},
1230 "bar/bar.proto": {moduleFullName: "buf.test/acme/foobar"},
1231 },
1232 workspaceDir,
1233 "--exclude-path",
1234 filepath.Join(workspaceDir, "proto", "foo", "internal", "foo_internal.proto"),
1235 "--exclude-path",
1236 filepath.Join(workspaceDir, "proto", "bar", "internal", "bar_internal.proto"),
1237 )
1238}
1239
1240func TestWorkspaceDuplicateFail(t *testing.T) {
1241 t.Parallel()

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…