tests to ensure more bad formats fail

This commit is contained in:
Aaron Raddon
2018-04-18 17:36:22 -07:00
parent d5da6dcdf6
commit 4b079c6fdd
2 changed files with 19 additions and 1 deletions

View File

@@ -45,7 +45,6 @@ const (
dateAlphaWsAlphaYearmaybe
dateWeekdayComma
dateWeekdayAbbrevComma
//dateWeekdayAbbrevCommaDash
)
const (
// Time state
@@ -356,6 +355,7 @@ iterRunes:
i += (bytesConsumed - 1)
}
//gou.Debugf("i=%d r=%s state=%d %s", i, string(r), p.stateDate, datestr)
switch p.stateDate {
case dateStart:
if unicode.IsDigit(r) {
@@ -421,6 +421,8 @@ iterRunes:
case '年':
// Chinese Year
p.stateDate = dateDigitChineseYear
case ',':
return nil, fmt.Errorf("Unrecognized format %q", datestr)
default:
//if unicode.IsDigit(r) {
continue