This commit ensures 64-bit integers are used in various tests that other wise
fail in 32-bit architectures.
It also adds support for int64 and uint64 types in the template.convertToFloat
function to support the test changes.
Closes: 10481
Signed-off-by: Martina Ferrari <tina@debian.org>
pull/10492/head
Martina Ferrari3 years agocommitted byJulien Pivotto
text:"{{ range . }}{{ humanizeTimestamp . }}:{{ end }}",
input:[]int{math.MinInt64,math.MaxInt64},
input:[]int64{math.MinInt64,math.MaxInt64},
shouldFail:true,
errorMsg:`error executing template test: template: test:1:16: executing "test" at <humanizeTimestamp .>: error calling humanizeTimestamp: -9.223372036854776e+18 cannot be represented as a nanoseconds timestamp since it overflows int64`,
},
{
// HumanizeTimestamp - uint with error.
text:"{{ range . }}{{ humanizeTimestamp . }}:{{ end }}",
input:[]uint{math.MaxUint64},
input:[]uint64{math.MaxUint64},
shouldFail:true,
errorMsg:`error executing template test: template: test:1:16: executing "test" at <humanizeTimestamp .>: error calling humanizeTimestamp: 1.8446744073709552e+19 cannot be represented as a nanoseconds timestamp since it overflows int64`,