mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-09 12:37:49 +00:00
Added some new getters to the index
Also added map conversion utilities based on reported vacuum error https://github.com/daveshanley/vacuum/issues/417 also prevented the bundler from inlining root references. Signed-off-by: quobix <dave@quobix.com>
This commit is contained in:
@@ -132,6 +132,42 @@ func TestConvertInterfaceIntoStringMap(t *testing.T) {
|
||||
assert.Equal(t, "baby girl", parsed["melody"])
|
||||
}
|
||||
|
||||
func TestConvertInterfaceIntoStringMap_Float64(t *testing.T) {
|
||||
var d interface{}
|
||||
n := make(map[string]interface{})
|
||||
n["melody"] = 5.9
|
||||
d = n
|
||||
parsed := ConvertInterfaceIntoStringMap(d)
|
||||
assert.Equal(t, "5.9", parsed["melody"])
|
||||
}
|
||||
|
||||
func TestConvertInterfaceIntoStringMap_Bool(t *testing.T) {
|
||||
var d interface{}
|
||||
n := make(map[string]interface{})
|
||||
n["melody"] = true
|
||||
d = n
|
||||
parsed := ConvertInterfaceIntoStringMap(d)
|
||||
assert.Equal(t, "true", parsed["melody"])
|
||||
}
|
||||
|
||||
func TestConvertInterfaceIntoStringMap_int64(t *testing.T) {
|
||||
var d interface{}
|
||||
n := make(map[string]interface{})
|
||||
n["melody"] = int64(12345)
|
||||
d = n
|
||||
parsed := ConvertInterfaceIntoStringMap(d)
|
||||
assert.Equal(t, "12345", parsed["melody"])
|
||||
}
|
||||
|
||||
func TestConvertInterfaceIntoStringMap_int(t *testing.T) {
|
||||
var d interface{}
|
||||
n := make(map[string]interface{})
|
||||
n["melody"] = 12345
|
||||
d = n
|
||||
parsed := ConvertInterfaceIntoStringMap(d)
|
||||
assert.Equal(t, "12345", parsed["melody"])
|
||||
}
|
||||
|
||||
func TestConvertInterfaceIntoStringMap_NoType(t *testing.T) {
|
||||
var d interface{}
|
||||
n := make(map[string]interface{})
|
||||
|
||||
Reference in New Issue
Block a user