Fix failing tests
This commit is contained in:
parent
3cbf1a3230
commit
aa2015ccd0
|
@ -237,13 +237,13 @@ func (w *MapFieldWriter) setPrimitive(
|
||||||
if err := mapstructure.Decode(v, &n); err != nil {
|
if err := mapstructure.Decode(v, &n); err != nil {
|
||||||
return fmt.Errorf("%s: %s", k, err)
|
return fmt.Errorf("%s: %s", k, err)
|
||||||
}
|
}
|
||||||
|
set = strconv.FormatInt(int64(n), 10)
|
||||||
case TypeFloat:
|
case TypeFloat:
|
||||||
var n float64
|
var n float64
|
||||||
if err := mapstructure.Decode(v, &n); err != nil {
|
if err := mapstructure.Decode(v, &n); err != nil {
|
||||||
return fmt.Errorf("%s: %s", k, err)
|
return fmt.Errorf("%s: %s", k, err)
|
||||||
}
|
}
|
||||||
|
set = strconv.FormatFloat(float64(n), 'G', -1, 64)
|
||||||
set = strconv.FormatInt(int64(n), 10)
|
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("Unknown type: %#v", schema.Type)
|
return fmt.Errorf("Unknown type: %#v", schema.Type)
|
||||||
}
|
}
|
||||||
|
|
|
@ -633,7 +633,7 @@ func TestResourceDataGet(t *testing.T) {
|
||||||
|
|
||||||
Key: "ratio",
|
Key: "ratio",
|
||||||
|
|
||||||
Value: []interface{}{0.0},
|
Value: 0.0,
|
||||||
},
|
},
|
||||||
|
|
||||||
// #21 Float given
|
// #21 Float given
|
||||||
|
@ -657,7 +657,7 @@ func TestResourceDataGet(t *testing.T) {
|
||||||
|
|
||||||
Key: "ratio",
|
Key: "ratio",
|
||||||
|
|
||||||
Value: []interface{}{0.5},
|
Value: 0.5,
|
||||||
},
|
},
|
||||||
|
|
||||||
// #22 Float diff
|
// #22 Float diff
|
||||||
|
@ -689,7 +689,7 @@ func TestResourceDataGet(t *testing.T) {
|
||||||
|
|
||||||
Key: "ratio",
|
Key: "ratio",
|
||||||
|
|
||||||
Value: []interface{}{33.0},
|
Value: 33.0,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue