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

Function TestTypes

private/bufpkg/bufimage/bufimageutil/bufimageutil_test.go:52–137  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

50var shouldUpdateExpectations = os.Getenv("BUFBUILD_BUF_BUFIMAGEUTIL_SHOULD_UPDATE_EXPECTATIONS")
51
52func TestTypes(t *testing.T) {
53 t.Parallel()
54 t.Run("message", func(t *testing.T) {
55 t.Parallel()
56 runDiffTest(t, "testdata/options", "pkg.Foo.txtar", WithIncludeTypes("pkg.Foo"))
57 })
58 t.Run("enum", func(t *testing.T) {
59 t.Parallel()
60 runDiffTest(t, "testdata/options", "pkg.FooEnum.txtar", WithIncludeTypes("pkg.FooEnum"))
61 })
62 t.Run("service", func(t *testing.T) {
63 t.Parallel()
64 runDiffTest(t, "testdata/options", "pkg.FooService.txtar", WithIncludeTypes("pkg.FooService"))
65 })
66 t.Run("method", func(t *testing.T) {
67 t.Parallel()
68 runDiffTest(t, "testdata/options", "pkg.FooService.Do.txtar", WithIncludeTypes("pkg.FooService.Do"))
69 })
70 t.Run("all", func(t *testing.T) {
71 t.Parallel()
72 runDiffTest(t, "testdata/options", "all.txtar", WithIncludeTypes("pkg.Foo", "pkg.FooEnum", "pkg.FooService"))
73 })
74 t.Run("exclude-options", func(t *testing.T) {
75 t.Parallel()
76 runDiffTest(t, "testdata/options", "all-exclude-options.txtar", WithIncludeTypes("pkg.Foo", "pkg.FooEnum", "pkg.FooService"), WithExcludeCustomOptions())
77 })
78 t.Run("files", func(t *testing.T) {
79 t.Parallel()
80 runDiffTest(t, "testdata/options", "Files.txtar", WithIncludeTypes("Files"))
81 })
82 t.Run("all-with-files", func(t *testing.T) {
83 t.Parallel()
84 runDiffTest(t, "testdata/options", "all-with-Files.txtar", WithIncludeTypes("pkg.Foo", "pkg.FooEnum", "pkg.FooService", "Files"))
85 })
86
87 t.Run("exclude-message", func(t *testing.T) {
88 t.Parallel()
89 runDiffTest(t, "testdata/options", "pkg.Foo.exclude.txtar", WithExcludeTypes("pkg.Foo"))
90 })
91 t.Run("exclude-enum", func(t *testing.T) {
92 t.Parallel()
93 runDiffTest(t, "testdata/options", "pkg.FooEnum.exclude.txtar", WithExcludeTypes("pkg.FooEnum"))
94 })
95 t.Run("exclude-service", func(t *testing.T) {
96 t.Parallel()
97 runDiffTest(t, "testdata/options", "pkg.FooService.exclude.txtar", WithExcludeTypes("pkg.FooService"))
98 })
99 t.Run("exclude-method", func(t *testing.T) {
100 t.Parallel()
101 runDiffTest(t, "testdata/options", "pkg.FooService.Do.exclude.txtar", WithExcludeTypes("pkg.FooService.Do"))
102 })
103 t.Run("exclude-package", func(t *testing.T) {
104 t.Parallel()
105 runDiffTest(t, "testdata/options", "pkg.Pkg.exclude.txtar", WithExcludeTypes("pkg"))
106 })
107 t.Run("exclude-all", func(t *testing.T) {
108 t.Parallel()
109 runDiffTest(t, "testdata/options", "all.exclude.txtar", WithExcludeTypes("pkg.Foo", "pkg.FooEnum", "pkg.FooService"))

Callers

nothing calls this directly

Calls 10

NewLoggerFunction · 0.92
runDiffTestFunction · 0.85
WithIncludeTypesFunction · 0.85
WithExcludeCustomOptionsFunction · 0.85
WithExcludeTypesFunction · 0.85
getImageFunction · 0.85
FilterImageFunction · 0.85
RunMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…