amazon-ion / ion-go

A Go implementation of Amazon Ion.

Home Page:https://amazon-ion.github.io/ion-docs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Timestamp fractional seconds with positive exponent and non zero coefficient should return an error

desaikd opened this issue · comments

PR #181 which addressed the issue #180 didn't include an error when timestamp fractional second has positive exponent and non zero coefficient .

// check if the scale is negative and coefficient is zero then set exponent value to 0
// otherwise set exponent value as per the scale value
if d.scale < 0 && nsec == 0 {
   exponent = uint8(0)  // if nsec != 0 && d.scale < 0 then RETURN AN ERROR
} else {
   exponent = uint8(d.scale)
}

Also, there are no tests in the test harness for timestamp fractional second with positive exponent and non zero coefficient We should add more tests for timestamp fractional seconds.