Closed sandstrom closed 6 years ago
Thanks, I think using rescue
here is ok.
Can you add two tests test_text_invalid_date_column
and test_text_invalid_date_time_column
to test/xlsxtream/row_test.rb
that exercises the new code?
There's no need to replicate all the different variants for date_time formats, a single example as for date should suffice.
@sandstrom Thanks for the contribution. I've added the two test mentioned above myself in 9159bc34692557899b21b63fac84cba3bda6429c.
I'll do a new patch release shortly.
@felixbuenemann Awesome! 😄
I did write down a todo-item to add the tests, but I've been busy with moving so I haven't had any spare time this past week.
For example, the string '2018-02-29' will match
DATE_PATTERN
butDate.parse
will throw an ArgumentError when parsing the string.Returning value instead yields the same result as a much more complicated regular expression would (regexps that takes leap years into account are needlessly complicated).
@felixbuenemann Let me know what you think!