mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-08 04:20:17 +00:00
Fixed flaky test in what changed
There is no order guarantee once parsed, I need to stop nmaking this mistake. Signed-off-by: Dave Shanley <dave@quobix.com>
This commit is contained in:
@@ -197,11 +197,16 @@ mapping:
|
|||||||
extChanges := CompareDiscriminator(&lDoc, &rDoc)
|
extChanges := CompareDiscriminator(&lDoc, &rDoc)
|
||||||
assert.Equal(t, 2, extChanges.TotalChanges())
|
assert.Equal(t, 2, extChanges.TotalChanges())
|
||||||
assert.Equal(t, ObjectAdded, extChanges.MappingChanges[0].ChangeType)
|
assert.Equal(t, ObjectAdded, extChanges.MappingChanges[0].ChangeType)
|
||||||
assert.Equal(t, "hacking", extChanges.MappingChanges[0].Property)
|
|
||||||
assert.Equal(t, "coding", extChanges.MappingChanges[0].New)
|
|
||||||
assert.Equal(t, "singing", extChanges.MappingChanges[1].Property)
|
|
||||||
assert.Equal(t, "dancing", extChanges.MappingChanges[1].New)
|
|
||||||
|
|
||||||
|
for _, k := range extChanges.MappingChanges {
|
||||||
|
assert.Equal(t, ObjectAdded, k.ChangeType)
|
||||||
|
if k.Property == "hacking" {
|
||||||
|
assert.Equal(t, "coding", k.New)
|
||||||
|
}
|
||||||
|
if k.Property == "singing" {
|
||||||
|
assert.Equal(t, "dancing", k.New)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestCompareDiscriminator_SingleMappingModified(t *testing.T) {
|
func TestCompareDiscriminator_SingleMappingModified(t *testing.T) {
|
||||||
|
|||||||
Reference in New Issue
Block a user