MCPcopy Create free account
hub / github.com/apache/dubbo-go / TestEncoder_Encode_JSONCompact

Function TestEncoder_Encode_JSONCompact

protocol/triple/openapi/encoder_test.go:66–78  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

64}
65
66func TestEncoder_Encode_JSONCompact(t *testing.T) {
67 e := NewEncoder()
68 openAPI := model.NewOpenAPI()
69 openAPI.Info.Title = "Test API"
70
71 result, err := e.Encode(openAPI, "json", false)
72 if err != nil {
73 t.Fatalf("unexpected error: %v", err)
74 }
75 if strings.Contains(result, "\n ") {
76 t.Error("compact JSON should not contain indentation")
77 }
78}
79
80func TestEncoder_Encode_YAML(t *testing.T) {
81 e := NewEncoder()

Callers

nothing calls this directly

Calls 6

EncodeMethod · 0.95
NewOpenAPIFunction · 0.92
NewEncoderFunction · 0.85
FatalfMethod · 0.65
ContainsMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected