@@ -95,6 +95,14 @@ class IntervalUtilsSuite extends SparkFunSuite {
9595 // Only the seconds units can have the fractional part
9696 checkFromInvalidString(" 1.5 days" , " 'days' with fractional part is unsupported" )
9797 checkFromInvalidString(" 1. hour" , " 'hour' with fractional part is unsupported" )
98+ checkFromInvalidString(" 1 hourX" , " invalid unit suffix" )
99+ checkFromInvalidString(" ~1 hour" , " unrecognized sign" )
100+ checkFromInvalidString(" 1 Mour" , " invalid unit 'mour'" )
101+ checkFromInvalidString(" 1 aour" , " invalid unit 'aour'" )
102+ checkFromInvalidString(" 1a1 hour" , " invalid value 'a1'" )
103+ checkFromInvalidString(" 1.1a1 seconds" , " invalid value fractional part 'a1'" )
104+ checkFromInvalidString(" 2234567890 days" , " integer overflow" )
105+
98106 }
99107
100108 test(" string to interval: seconds with fractional part" ) {
@@ -106,7 +114,8 @@ class IntervalUtilsSuite extends SparkFunSuite {
106114 checkFromString(" -1.5 seconds" , new CalendarInterval (0 , 0 , - 1500000 ))
107115 // truncate nanoseconds to microseconds
108116 checkFromString(" 0.999999999 seconds" , new CalendarInterval (0 , 0 , 999999 ))
109- checkFromInvalidString(" 0.123456789123 seconds" , " invalid value fractional part '123456789123'" )
117+ checkFromString(" .999999999 seconds" , new CalendarInterval (0 , 0 , 999999 ))
118+ checkFromInvalidString(" 0.123456789123 seconds" , " '123456789123' out of range" )
110119 }
111120
112121 test(" from year-month string" ) {
0 commit comments