mirror of
https://github.com/dolthub/dolt.git
synced 2026-02-11 10:33:08 -06:00
/go/libraries/doltcore/env/actions/{infer_schema}_test.go: fix tests
This commit is contained in:
@@ -226,7 +226,7 @@ func leastPermissiveNumericType(strVal string, floatThreshold float64) (ti typei
|
||||
}
|
||||
|
||||
// handle leading zero case
|
||||
if strVal[0] == '0' {
|
||||
if len(strVal) > 1 && strVal[0] == '0' {
|
||||
return typeinfo.StringDefaultType
|
||||
}
|
||||
|
||||
|
||||
@@ -81,8 +81,8 @@ func TestLeastPermissiveNumericType(t *testing.T) {
|
||||
{"negative float", "-1.3451234", 0.0, typeinfo.Float32Type},
|
||||
{"double decimal point", "0.00.0", 0.0, typeinfo.UnknownType},
|
||||
{"zero float with high precision", "0.0000", 0.0, typeinfo.Float32Type},
|
||||
{"all zeroes", "0000", 0.0, typeinfo.Uint32Type},
|
||||
{"leading zeroes", "01", 0.0, typeinfo.Uint32Type},
|
||||
{"all zeroes", "0000", 0.0, typeinfo.StringDefaultType},
|
||||
{"leading zeroes", "01", 0.0, typeinfo.StringDefaultType},
|
||||
{"negative int", "-1234", 0.0, typeinfo.Int32Type},
|
||||
{"fits in uint64 but not int64", strconv.FormatUint(math.MaxUint64, 10), 0.0, typeinfo.Uint64Type},
|
||||
{"negative less than math.MinInt64", "-" + strconv.FormatUint(math.MaxUint64, 10), 0.0, typeinfo.UnknownType},
|
||||
|
||||
Reference in New Issue
Block a user