mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-06 12:37:49 +00:00
fix tests
This commit is contained in:
@@ -325,7 +325,7 @@ func TestExampleCompareDocuments_openAPI(t *testing.T) {
|
|||||||
schemaChanges := documentChanges.ComponentsChanges.SchemaChanges
|
schemaChanges := documentChanges.ComponentsChanges.SchemaChanges
|
||||||
|
|
||||||
// Print out some interesting stats about the OpenAPI document changes.
|
// Print out some interesting stats about the OpenAPI document changes.
|
||||||
assert.Equal(t, `There are 75 changes, of which 19 are breaking. 6 schemas have changes.`, fmt.Sprintf("There are %d changes, of which %d are breaking. %v schemas have changes.",
|
assert.Equal(t, `There are 75 changes, of which 20 are breaking. 6 schemas have changes.`, fmt.Sprintf("There are %d changes, of which %d are breaking. %v schemas have changes.",
|
||||||
documentChanges.TotalChanges(), documentChanges.TotalBreakingChanges(), len(schemaChanges)))
|
documentChanges.TotalChanges(), documentChanges.TotalBreakingChanges(), len(schemaChanges)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ func TestCreateSummary_OverallReport(t *testing.T) {
|
|||||||
report := CreateOverallReport(changes)
|
report := CreateOverallReport(changes)
|
||||||
assert.Equal(t, 1, report.ChangeReport[v3.InfoLabel].Total)
|
assert.Equal(t, 1, report.ChangeReport[v3.InfoLabel].Total)
|
||||||
assert.Equal(t, 43, report.ChangeReport[v3.PathsLabel].Total)
|
assert.Equal(t, 43, report.ChangeReport[v3.PathsLabel].Total)
|
||||||
assert.Equal(t, 9, report.ChangeReport[v3.PathsLabel].Breaking)
|
assert.Equal(t, 10, report.ChangeReport[v3.PathsLabel].Breaking)
|
||||||
assert.Equal(t, 3, report.ChangeReport[v3.TagsLabel].Total)
|
assert.Equal(t, 3, report.ChangeReport[v3.TagsLabel].Total)
|
||||||
assert.Equal(t, 1, report.ChangeReport[v3.ExternalDocsLabel].Total)
|
assert.Equal(t, 1, report.ChangeReport[v3.ExternalDocsLabel].Total)
|
||||||
assert.Equal(t, 2, report.ChangeReport[v3.WebhooksLabel].Total)
|
assert.Equal(t, 2, report.ChangeReport[v3.WebhooksLabel].Total)
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ func TestCompareOpenAPIDocuments(t *testing.T) {
|
|||||||
|
|
||||||
changes := CompareOpenAPIDocuments(origDoc, modDoc)
|
changes := CompareOpenAPIDocuments(origDoc, modDoc)
|
||||||
assert.Equal(t, 75, changes.TotalChanges())
|
assert.Equal(t, 75, changes.TotalChanges())
|
||||||
assert.Equal(t, 19, changes.TotalBreakingChanges())
|
assert.Equal(t, 20, changes.TotalBreakingChanges())
|
||||||
//out, _ := json.MarshalIndent(changes, "", " ")
|
//out, _ := json.MarshalIndent(changes, "", " ")
|
||||||
//_ = os.WriteFile("outputv3.json", out, 0776)
|
//_ = os.WriteFile("outputv3.json", out, 0776)
|
||||||
}
|
}
|
||||||
@@ -150,5 +150,5 @@ func ExampleCompareOpenAPIDocuments() {
|
|||||||
// Print out some interesting stats.
|
// Print out some interesting stats.
|
||||||
fmt.Printf("There are %d changes, of which %d are breaking. %v schemas have changes.",
|
fmt.Printf("There are %d changes, of which %d are breaking. %v schemas have changes.",
|
||||||
changes.TotalChanges(), changes.TotalBreakingChanges(), len(schemaChanges))
|
changes.TotalChanges(), changes.TotalBreakingChanges(), len(schemaChanges))
|
||||||
//Output: There are 75 changes, of which 19 are breaking. 6 schemas have changes.
|
//Output: There are 75 changes, of which 20 are breaking. 6 schemas have changes.
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user