(t *testing.T)
| 49 | } |
| 50 | |
| 51 | func TestEncoder_Encode_JSONPretty(t *testing.T) { |
| 52 | e := NewEncoder() |
| 53 | openAPI := model.NewOpenAPI() |
| 54 | openAPI.Info.Title = "Test API" |
| 55 | openAPI.Info.Version = "1.0.0" |
| 56 | |
| 57 | result, err := e.Encode(openAPI, "json", true) |
| 58 | if err != nil { |
| 59 | t.Fatalf("unexpected error: %v", err) |
| 60 | } |
| 61 | if !strings.Contains(result, " ") { |
| 62 | t.Error("pretty JSON should contain indentation") |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | func TestEncoder_Encode_JSONCompact(t *testing.T) { |
| 67 | e := NewEncoder() |
nothing calls this directly
no test coverage detected