Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tomltestgen failing tests #613

Closed
pelletier opened this issue Oct 4, 2021 · 17 comments
Closed

Fix tomltestgen failing tests #613

pelletier opened this issue Oct 4, 2021 · 17 comments
Labels
bug Issues describing a bug in go-toml. good first issue Issues that are suitable for first-time contributors. v2 Issues impacting the v2 major version.
Milestone

Comments

@pelletier
Copy link
Owner

pelletier commented Oct 4, 2021

After merging #610 the toml-test generated tests have been disabled from automatic build because some tests are failing.

This issue tracks fixing the failing tests and ultimately make the toml-test generated tests part of the regular build again.

For new comers, a lot of those issues are corner cases that should be easy to tackle. Feel free to create a pull request for any of them!

Make sure to remove the Skip() call of the test you're trying to fix in the PR.

Tests results

$ echo -e "Status at $(git rev-parse HEAD):\n" && go test -tags testsuite -v -run TestTOML|grep -a -E "(PASS|SKIP):" |sed -E 's/.+(PASS|SKIP): (.+) .+/- [\1] `go test -run \2`/'|sed 's/PASS/x/'|sed 's/SKIP/ /'

Status at 39f893a:

  • go test -run TestTOMLTest_Invalid_Array_MissingSeparator
  • go test -run TestTOMLTest_Invalid_Array_NoClose2
  • go test -run TestTOMLTest_Invalid_Array_NoCloseTable2
  • go test -run TestTOMLTest_Invalid_Array_NoCloseTable
  • go test -run TestTOMLTest_Invalid_Array_NoClose
  • go test -run TestTOMLTest_Invalid_Array_Tables1
  • go test -run TestTOMLTest_Invalid_Array_Tables2
  • go test -run TestTOMLTest_Invalid_Array_TextAfterArrayEntries
  • go test -run TestTOMLTest_Invalid_Array_TextBeforeArraySeparator
  • go test -run TestTOMLTest_Invalid_Array_TextInArray
  • go test -run TestTOMLTest_Invalid_Bool_MixedCase
  • go test -run TestTOMLTest_Invalid_Bool_WrongCaseFalse
  • go test -run TestTOMLTest_Invalid_Bool_WrongCaseTrue
  • go test -run TestTOMLTest_Invalid_Control_CommentDel
  • go test -run TestTOMLTest_Invalid_Control_CommentLf
  • go test -run TestTOMLTest_Invalid_Control_CommentNull
  • go test -run TestTOMLTest_Invalid_Control_CommentUs
  • go test -run TestTOMLTest_Invalid_Control_MultiDel
  • go test -run TestTOMLTest_Invalid_Control_MultiLf
  • go test -run TestTOMLTest_Invalid_Control_MultiNull
  • go test -run TestTOMLTest_Invalid_Control_MultiUs
  • go test -run TestTOMLTest_Invalid_Control_RawmultiDel
  • go test -run TestTOMLTest_Invalid_Control_RawmultiLf
  • go test -run TestTOMLTest_Invalid_Control_RawmultiNull
  • go test -run TestTOMLTest_Invalid_Control_RawmultiUs
  • go test -run TestTOMLTest_Invalid_Control_RawstringDel
  • go test -run TestTOMLTest_Invalid_Control_RawstringLf
  • go test -run TestTOMLTest_Invalid_Control_RawstringNull
  • go test -run TestTOMLTest_Invalid_Control_RawstringUs
  • go test -run TestTOMLTest_Invalid_Control_StringBs
  • go test -run TestTOMLTest_Invalid_Control_StringDel
  • go test -run TestTOMLTest_Invalid_Control_StringLf
  • go test -run TestTOMLTest_Invalid_Control_StringNull
  • go test -run TestTOMLTest_Invalid_Control_StringUs
  • go test -run TestTOMLTest_Invalid_Datetime_ImpossibleDate
  • go test -run TestTOMLTest_Invalid_Datetime_NoLeadsWithMilli
  • go test -run TestTOMLTest_Invalid_Datetime_NoLeads
  • go test -run TestTOMLTest_Invalid_Datetime_NoSecs
  • go test -run TestTOMLTest_Invalid_Datetime_NoT
  • go test -run TestTOMLTest_Invalid_Datetime_TrailingT
  • go test -run TestTOMLTest_Invalid_Encoding_BadUtf8AtEnd
  • go test -run TestTOMLTest_Invalid_Encoding_BadUtf8InComment
  • go test -run TestTOMLTest_Invalid_Encoding_BadUtf8InString
  • go test -run TestTOMLTest_Invalid_Encoding_BomNotAtStart1
  • go test -run TestTOMLTest_Invalid_Encoding_BomNotAtStart2
  • go test -run TestTOMLTest_Invalid_Encoding_Utf16Bom
  • go test -run TestTOMLTest_Invalid_Encoding_Utf16
  • go test -run TestTOMLTest_Invalid_Float_DoublePoint1
  • go test -run TestTOMLTest_Invalid_Float_DoublePoint2
  • go test -run TestTOMLTest_Invalid_Float_ExpDoubleE1
  • go test -run TestTOMLTest_Invalid_Float_ExpDoubleE2
  • go test -run TestTOMLTest_Invalid_Float_ExpDoubleUs
  • go test -run TestTOMLTest_Invalid_Float_ExpLeadingUs
  • go test -run TestTOMLTest_Invalid_Float_ExpPoint1
  • go test -run TestTOMLTest_Invalid_Float_ExpPoint2
  • go test -run TestTOMLTest_Invalid_Float_ExpTrailingUs
  • go test -run TestTOMLTest_Invalid_Float_InfIncomplete1
  • go test -run TestTOMLTest_Invalid_Float_InfIncomplete2
  • go test -run TestTOMLTest_Invalid_Float_InfIncomplete3
  • go test -run TestTOMLTest_Invalid_Float_Inf_underscore
  • go test -run TestTOMLTest_Invalid_Float_LeadingPointNeg
  • go test -run TestTOMLTest_Invalid_Float_LeadingPointPlus
  • go test -run TestTOMLTest_Invalid_Float_LeadingPoint
  • go test -run TestTOMLTest_Invalid_Float_LeadingUs
  • go test -run TestTOMLTest_Invalid_Float_LeadingZeroNeg
  • go test -run TestTOMLTest_Invalid_Float_LeadingZeroPlus
  • go test -run TestTOMLTest_Invalid_Float_LeadingZero
  • go test -run TestTOMLTest_Invalid_Float_NanIncomplete1
  • go test -run TestTOMLTest_Invalid_Float_NanIncomplete2
  • go test -run TestTOMLTest_Invalid_Float_NanIncomplete3
  • go test -run TestTOMLTest_Invalid_Float_Nan_underscore
  • go test -run TestTOMLTest_Invalid_Float_TrailingPointMin
  • go test -run TestTOMLTest_Invalid_Float_TrailingPointPlus
  • go test -run TestTOMLTest_Invalid_Float_TrailingPoint
  • go test -run TestTOMLTest_Invalid_Float_TrailingUs
  • go test -run TestTOMLTest_Invalid_Float_UsAfterPoint
  • go test -run TestTOMLTest_Invalid_Float_UsBeforePoint
  • go test -run TestTOMLTest_Invalid_InlineTable_DoubleComma
  • go test -run TestTOMLTest_Invalid_InlineTable_Empty
  • go test -run TestTOMLTest_Invalid_InlineTable_Linebreak1
  • go test -run TestTOMLTest_Invalid_InlineTable_Linebreak2
  • go test -run TestTOMLTest_Invalid_InlineTable_Linebreak3
  • go test -run TestTOMLTest_Invalid_InlineTable_Linebreak4
  • go test -run TestTOMLTest_Invalid_InlineTable_NoComma
  • go test -run TestTOMLTest_Invalid_InlineTable_TrailingComma
  • go test -run TestTOMLTest_Invalid_Integer_CapitalBin
  • go test -run TestTOMLTest_Invalid_Integer_CapitalHex
  • go test -run TestTOMLTest_Invalid_Integer_CapitalOct
  • go test -run TestTOMLTest_Invalid_Integer_DoubleSignNex
  • go test -run TestTOMLTest_Invalid_Integer_DoubleSignPlus
  • go test -run TestTOMLTest_Invalid_Integer_DoubleUs
  • go test -run TestTOMLTest_Invalid_Integer_InvalidBin
  • go test -run TestTOMLTest_Invalid_Integer_InvalidHex
  • go test -run TestTOMLTest_Invalid_Integer_InvalidOct
  • go test -run TestTOMLTest_Invalid_Integer_LeadingUsBin
  • go test -run TestTOMLTest_Invalid_Integer_LeadingUsHex
  • go test -run TestTOMLTest_Invalid_Integer_LeadingUsOct
  • go test -run TestTOMLTest_Invalid_Integer_LeadingUs
  • go test -run TestTOMLTest_Invalid_Integer_LeadingZero1
  • go test -run TestTOMLTest_Invalid_Integer_LeadingZero2
  • go test -run TestTOMLTest_Invalid_Integer_LeadingZeroSign1
  • go test -run TestTOMLTest_Invalid_Integer_LeadingZeroSign2
  • go test -run TestTOMLTest_Invalid_Integer_NegativeBin
  • go test -run TestTOMLTest_Invalid_Integer_NegativeHex
  • go test -run TestTOMLTest_Invalid_Integer_NegativeOct
  • go test -run TestTOMLTest_Invalid_Integer_PositiveBin
  • go test -run TestTOMLTest_Invalid_Integer_PositiveHex
  • go test -run TestTOMLTest_Invalid_Integer_PositiveOct
  • go test -run TestTOMLTest_Invalid_Integer_TextAfterInteger
  • go test -run TestTOMLTest_Invalid_Integer_TrailingUsBin
  • go test -run TestTOMLTest_Invalid_Integer_TrailingUsHex
  • go test -run TestTOMLTest_Invalid_Integer_TrailingUsOct
  • go test -run TestTOMLTest_Invalid_Integer_TrailingUs
  • go test -run TestTOMLTest_Invalid_Integer_UsAfterBin
  • go test -run TestTOMLTest_Invalid_Integer_UsAfterHex
  • go test -run TestTOMLTest_Invalid_Integer_UsAfterOct
  • go test -run TestTOMLTest_Invalid_Key_AfterArray
  • go test -run TestTOMLTest_Invalid_Key_AfterTable
  • go test -run TestTOMLTest_Invalid_Key_AfterValue
  • go test -run TestTOMLTest_Invalid_Key_BareInvalidCharacter
  • go test -run TestTOMLTest_Invalid_Key_DottedRedefineTable
  • go test -run TestTOMLTest_Invalid_Key_DuplicateKeys
  • go test -run TestTOMLTest_Invalid_Key_Duplicate
  • go test -run TestTOMLTest_Invalid_Key_Empty
  • go test -run TestTOMLTest_Invalid_Key_Escape
  • go test -run TestTOMLTest_Invalid_Key_Hash
  • go test -run TestTOMLTest_Invalid_Key_Multiline
  • go test -run TestTOMLTest_Invalid_Key_Newline
  • go test -run TestTOMLTest_Invalid_Key_NoEol
  • go test -run TestTOMLTest_Invalid_Key_OpenBracket
  • go test -run TestTOMLTest_Invalid_Key_PartialQuoted
  • go test -run TestTOMLTest_Invalid_Key_SingleOpenBracket
  • go test -run TestTOMLTest_Invalid_Key_Space
  • go test -run TestTOMLTest_Invalid_Key_SpecialCharacter
  • go test -run TestTOMLTest_Invalid_Key_StartBracket
  • go test -run TestTOMLTest_Invalid_Key_TwoEquals
  • go test -run TestTOMLTest_Invalid_Key_TwoEquals2
  • go test -run TestTOMLTest_Invalid_Key_TwoEquals3
  • go test -run TestTOMLTest_Invalid_Key_WithoutValue1
  • go test -run TestTOMLTest_Invalid_Key_WithoutValue2
  • go test -run TestTOMLTest_Invalid_String_BadByteEscape
  • go test -run TestTOMLTest_Invalid_String_BadCodepoint
  • go test -run TestTOMLTest_Invalid_String_BadConcat
  • go test -run TestTOMLTest_Invalid_String_BadEscape
  • go test -run TestTOMLTest_Invalid_String_BadMultiline
  • go test -run TestTOMLTest_Invalid_String_BadSlashEscape
  • go test -run TestTOMLTest_Invalid_String_BadUniEsc
  • go test -run TestTOMLTest_Invalid_String_BasicByteEscapes
  • go test -run TestTOMLTest_Invalid_String_BasicMultilineOutOfRangeUnicodeEscape1
  • go test -run TestTOMLTest_Invalid_String_BasicMultilineOutOfRangeUnicodeEscape2
  • go test -run TestTOMLTest_Invalid_String_BasicMultilineQuotes
  • go test -run TestTOMLTest_Invalid_String_BasicMultilineUnknownEscape
  • go test -run TestTOMLTest_Invalid_String_BasicOutOfRangeUnicodeEscape1
  • go test -run TestTOMLTest_Invalid_String_BasicOutOfRangeUnicodeEscape2
  • go test -run TestTOMLTest_Invalid_String_BasicUnknownEscape
  • go test -run TestTOMLTest_Invalid_String_LiteralMultilineQuotes1
  • go test -run TestTOMLTest_Invalid_String_LiteralMultilineQuotes2
  • go test -run TestTOMLTest_Invalid_String_MissingQuotes
  • go test -run TestTOMLTest_Invalid_String_MultilineEscapeSpace
  • go test -run TestTOMLTest_Invalid_String_MultilineNoClose2
  • go test -run TestTOMLTest_Invalid_String_MultilineNoClose
  • go test -run TestTOMLTest_Invalid_String_MultilineQuotes1
  • go test -run TestTOMLTest_Invalid_String_MultilineQuotes2
  • go test -run TestTOMLTest_Invalid_String_NoClose
  • go test -run TestTOMLTest_Invalid_String_TextAfterString
  • go test -run TestTOMLTest_Invalid_String_WrongClose
  • go test -run TestTOMLTest_Invalid_Table_ArrayEmpty
  • go test -run TestTOMLTest_Invalid_Table_ArrayImplicit
  • go test -run TestTOMLTest_Invalid_Table_ArrayMissingBracket
  • go test -run TestTOMLTest_Invalid_Table_DuplicateKeyTable
  • go test -run TestTOMLTest_Invalid_Table_DuplicateTableArray
  • go test -run TestTOMLTest_Invalid_Table_DuplicateTableArray2
  • go test -run TestTOMLTest_Invalid_Table_Duplicate
  • go test -run TestTOMLTest_Invalid_Table_EmptyImplicitTable
  • go test -run TestTOMLTest_Invalid_Table_Empty
  • go test -run TestTOMLTest_Invalid_Table_EqualsSign
  • go test -run TestTOMLTest_Invalid_Table_Injection1
  • go test -run TestTOMLTest_Invalid_Table_Injection2
  • go test -run TestTOMLTest_Invalid_Table_Llbrace
  • go test -run TestTOMLTest_Invalid_Table_NestedBracketsClose
  • go test -run TestTOMLTest_Invalid_Table_NestedBracketsOpen
  • go test -run TestTOMLTest_Invalid_Table_QuotedNoClose
  • go test -run TestTOMLTest_Invalid_Table_Redefine
  • go test -run TestTOMLTest_Invalid_Table_Rrbrace
  • go test -run TestTOMLTest_Invalid_Table_TextAfterTable
  • go test -run TestTOMLTest_Invalid_Table_Whitespace
  • go test -run TestTOMLTest_Invalid_Table_WithPound
  • go test -run TestTOMLTest_Valid_Array_Array
  • go test -run TestTOMLTest_Valid_Array_Bool
  • go test -run TestTOMLTest_Valid_Array_Empty
  • go test -run TestTOMLTest_Valid_Array_Hetergeneous
  • go test -run TestTOMLTest_Valid_Array_MixedIntArray
  • go test -run TestTOMLTest_Valid_Array_MixedIntFloat
  • go test -run TestTOMLTest_Valid_Array_MixedIntString
  • go test -run TestTOMLTest_Valid_Array_MixedStringTable
  • go test -run TestTOMLTest_Valid_Array_NestedDouble
  • go test -run TestTOMLTest_Valid_Array_NestedInlineTable
  • go test -run TestTOMLTest_Valid_Array_Nested
  • go test -run TestTOMLTest_Valid_Array_Nospaces
  • go test -run TestTOMLTest_Valid_Array_StringQuoteComma2
  • go test -run TestTOMLTest_Valid_Array_StringQuoteComma
  • go test -run TestTOMLTest_Valid_Array_StringWithComma
  • go test -run TestTOMLTest_Valid_Array_Strings
  • go test -run TestTOMLTest_Valid_Array_TableArrayStringBackslash
  • go test -run TestTOMLTest_Valid_Bool_Bool
  • go test -run TestTOMLTest_Valid_Comment_AtEof
  • go test -run TestTOMLTest_Valid_Comment_AtEof2
  • go test -run TestTOMLTest_Valid_Comment_Everywhere
  • go test -run TestTOMLTest_Valid_Comment_Tricky
  • go test -run TestTOMLTest_Valid_Datetime_Datetime
  • go test -run TestTOMLTest_Valid_Datetime_LocalDate
  • go test -run TestTOMLTest_Valid_Datetime_LocalTime
  • go test -run TestTOMLTest_Valid_Datetime_Local
  • go test -run TestTOMLTest_Valid_Datetime_Milliseconds
  • go test -run TestTOMLTest_Valid_Datetime_Timezone
  • go test -run TestTOMLTest_Valid_EmptyFile
  • go test -run TestTOMLTest_Valid_Example
  • go test -run TestTOMLTest_Valid_Float_Exponent
  • go test -run TestTOMLTest_Valid_Float_Float
  • go test -run TestTOMLTest_Valid_Float_InfAndNan
  • go test -run TestTOMLTest_Valid_Float_Long
  • go test -run TestTOMLTest_Valid_Float_Underscore
  • go test -run TestTOMLTest_Valid_Float_Zero
  • go test -run TestTOMLTest_Valid_ImplicitAndExplicitAfter
  • go test -run TestTOMLTest_Valid_ImplicitAndExplicitBefore
  • go test -run TestTOMLTest_Valid_ImplicitGroups
  • go test -run TestTOMLTest_Valid_InlineTable_Array
  • go test -run TestTOMLTest_Valid_InlineTable_Bool
  • go test -run TestTOMLTest_Valid_InlineTable_Empty
  • go test -run TestTOMLTest_Valid_InlineTable_EndInBool
  • go test -run TestTOMLTest_Valid_InlineTable_InlineTable
  • go test -run TestTOMLTest_Valid_InlineTable_KeyDotted
  • go test -run TestTOMLTest_Valid_InlineTable_Multiline
  • go test -run TestTOMLTest_Valid_InlineTable_Nest
  • go test -run TestTOMLTest_Valid_Integer_Integer
  • go test -run TestTOMLTest_Valid_Integer_Literals
  • go test -run TestTOMLTest_Valid_Integer_Long
  • go test -run TestTOMLTest_Valid_Integer_Underscore
  • go test -run TestTOMLTest_Valid_Integer_Zero
  • go test -run TestTOMLTest_Valid_Key_Alphanum
  • go test -run TestTOMLTest_Valid_Key_CaseSensitive
  • go test -run TestTOMLTest_Valid_Key_Dotted
  • go test -run TestTOMLTest_Valid_Key_Empty
  • go test -run TestTOMLTest_Valid_Key_EqualsNospace
  • go test -run TestTOMLTest_Valid_Key_Escapes
  • go test -run TestTOMLTest_Valid_Key_NumericDotted
  • go test -run TestTOMLTest_Valid_Key_Numeric
  • go test -run TestTOMLTest_Valid_Key_QuotedDots
  • go test -run TestTOMLTest_Valid_Key_Space
  • go test -run TestTOMLTest_Valid_Key_SpecialChars
  • go test -run TestTOMLTest_Valid_Key_SpecialWord
  • go test -run TestTOMLTest_Valid_NewlineCrlf
  • go test -run TestTOMLTest_Valid_NewlineLf
  • go test -run TestTOMLTest_Valid_SpecExample1Compact
  • go test -run TestTOMLTest_Valid_SpecExample1
  • go test -run TestTOMLTest_Valid_String_DoubleQuoteEscape
  • go test -run TestTOMLTest_Valid_String_Empty
  • go test -run TestTOMLTest_Valid_String_EscapeTricky
  • go test -run TestTOMLTest_Valid_String_EscapedEscape
  • go test -run TestTOMLTest_Valid_String_Escapes
  • go test -run TestTOMLTest_Valid_String_MultilineQuotes
  • go test -run TestTOMLTest_Valid_String_Multiline
  • go test -run TestTOMLTest_Valid_String_Nl
  • go test -run TestTOMLTest_Valid_String_RawMultiline
  • go test -run TestTOMLTest_Valid_String_Raw
  • go test -run TestTOMLTest_Valid_String_Simple
  • go test -run TestTOMLTest_Valid_String_UnicodeEscape
  • go test -run TestTOMLTest_Valid_String_UnicodeLiteral
  • go test -run TestTOMLTest_Valid_String_WithPound
  • go test -run TestTOMLTest_Valid_Table_ArrayImplicit
  • go test -run TestTOMLTest_Valid_Table_ArrayMany
  • go test -run TestTOMLTest_Valid_Table_ArrayNest
  • go test -run TestTOMLTest_Valid_Table_ArrayOne
  • go test -run TestTOMLTest_Valid_Table_ArrayTableArray
  • go test -run TestTOMLTest_Valid_Table_Empty
  • go test -run TestTOMLTest_Valid_Table_Keyword
  • go test -run TestTOMLTest_Valid_Table_Names
  • go test -run TestTOMLTest_Valid_Table_NoEol
  • go test -run TestTOMLTest_Valid_Table_SubEmpty
  • go test -run TestTOMLTest_Valid_Table_Whitespace
  • go test -run TestTOMLTest_Valid_Table_WithLiteralString
  • go test -run TestTOMLTest_Valid_Table_WithPound
  • go test -run TestTOMLTest_Valid_Table_WithSingleQuotes
  • go test -run TestTOMLTest_Valid_Table_WithoutSuper
@pelletier pelletier added bug Issues describing a bug in go-toml. v2 Issues impacting the v2 major version. labels Oct 4, 2021
@pelletier pelletier added this to the v2.0.0-beta.4 milestone Oct 4, 2021
@pelletier pelletier added the good first issue Issues that are suitable for first-time contributors. label Oct 4, 2021
@jidicula
Copy link
Contributor

jidicula commented Oct 4, 2021

I'm taking a crack at go test -tags testsuite -run TestTOMLTest_Invalid_Array_MissingSeparator (first entry in the list)

@idodin
Copy link

idodin commented Oct 5, 2021

Trying out all the comment tests: go test -tags testsuite -run TestTOMLTest_Invalid_Control_CommentDel, go test -tags testsuite -run TestTOMLTest_Invalid_Control_CommentLf, go test -tags testsuite -run TestTOMLTest_Invalid_Control_CommentNull and go test -tags testsuite -run TestTOMLTest_Invalid_Control_CommentUs

@jidicula
Copy link
Contributor

jidicula commented Oct 5, 2021

@idodin I have a WIP for the TestTOMLTest_Invalid_Control_CommentDel that I'm about to push up actually. I'll be changing the return of scanComment() to return an error if an invalid char is encountered in a comment, so the other comment tests might need that functionality too.

@idodin
Copy link

idodin commented Oct 5, 2021

@jidicula - sounds good. Do you want to handle the rest of the comments, in that case? I can take a whack at the floats.

@jidicula
Copy link
Contributor

jidicula commented Oct 5, 2021

@idodin Sure thing

jidicula added a commit to jidicula/go-toml that referenced this issue Oct 5, 2021
When scanning comments, it makes better sense to halt scanning and
immediately return if an illegal character is encountered while
scanning. This can save on performance in the perverse case of an
extremely long comment that has an early offending character.

Related to: pelletier#613
jidicula added a commit to jidicula/go-toml that referenced this issue Oct 5, 2021
jidicula added a commit to jidicula/go-toml that referenced this issue Oct 5, 2021
jidicula added a commit to jidicula/go-toml that referenced this issue Oct 5, 2021
Oddly enough, the test passes when it shouldn't.

Partially resolves: pelletier#613
jidicula added a commit to jidicula/go-toml that referenced this issue Oct 5, 2021
Oddly enough, the test passes when it shouldn't.

Partially resolves: pelletier#613
jidicula added a commit to jidicula/go-toml that referenced this issue Oct 5, 2021
Previously, the generated tests from toml-test were not failing when
expected for NUL and US control characters. Using the Unicode values
for these tests instead of the \xNN notation corrected this failure.

Related to: pelletier#613
jidicula added a commit to jidicula/go-toml that referenced this issue Oct 5, 2021
jidicula added a commit to jidicula/go-toml that referenced this issue Oct 5, 2021
mjip added a commit to mjip/go-toml that referenced this issue Oct 6, 2021
@jidicula
Copy link
Contributor

jidicula commented Oct 8, 2021

Taking on go test -tags testsuite -run TestTOMLTest_Invalid_Datetime_ImpossibleDate now

jidicula added a commit to jidicula/go-toml that referenced this issue Oct 8, 2021
Constructs a datestring with RFC3339 formatting using the parsed date
values, then attempts to call `time.Parse()` on it, which returns a
non-nil error if datetime string was invalid or `time`'s parsing of
the string failed.

Resolves: part of pelletier#613
jidicula added a commit to jidicula/go-toml that referenced this issue Oct 8, 2021
The toml-test generated test for an array with missing separators was
failing since the parser wasn't noticing missing separators.

This change leverages the zero value of `ast.Reference` (an int). The
var is now declared outside the while block, and re-zeroed if the
token is not a non-trailing comma.

The parser checks if the previous value of `valueRef` is zero. The
only time this check would pass is when the previous byte in the array
was a whitespace, which would only be the case when an array is
missing a separator.

Resolves: part of pelletier#613
jidicula added a commit to jidicula/go-toml that referenced this issue Oct 10, 2021
Discovered missing check while addressing failing
`TestTOMLTest_Invalid_Datetime_ImpossibleDate` test case.

Related to pelletier#613
jidicula added a commit to jidicula/go-toml that referenced this issue Oct 15, 2021
Discovered missing checks while addressing failing
`TestTOMLTest_Invalid_Datetime_ImpossibleDate` test case.

Related to pelletier#613
@pelletier pelletier mentioned this issue Oct 15, 2021
28 tasks
jidicula added a commit to jidicula/go-toml that referenced this issue Oct 16, 2021
Copies date checking functionality from go.time.go to verify that the
provided date is indeed valid for a given year, accounting for leap
years.

Resolves: part of pelletier#613
jidicula added a commit to jidicula/go-toml that referenced this issue Oct 16, 2021
jidicula added a commit to jidicula/go-toml that referenced this issue Oct 16, 2021
Copies date checking functionality from go.time.go to verify that the
provided date is indeed valid for a given year, accounting for leap
years.

Resolves: part of pelletier#613
jidicula added a commit to jidicula/go-toml that referenced this issue Oct 16, 2021
jidicula added a commit to jidicula/go-toml that referenced this issue Oct 16, 2021
@jidicula
Copy link
Contributor

Working on go test -tags testsuite -run TestTOMLTest_Valid_Datetime_Local

@jidicula
Copy link
Contributor

Working on go test -tags testsuite -run TestTOMLTest_Valid_Datetime_Local

Note: the failing milli test case for this is fixed in #626. I'll be submitting a fix for the other local and space cases.

jidicula added a commit to jidicula/go-toml that referenced this issue Oct 17, 2021
RFC3339 specifies a `T` between date and time, not a space[1].

[1]: https://pkg.go.dev/time#pkg-constants

Resolves: part of pelletier#613
@jidicula
Copy link
Contributor

jidicula commented Oct 18, 2021

Working on go test -v -tags testsuite -run TestTOMLTest_Valid_String_MultilineQuotes, may also resolve go test -tags testsuite -run TestTOMLTest_Valid_String_Multiline.

jidicula added a commit to jidicula/go-toml that referenced this issue Oct 18, 2021
RFC3339 specifies a `T` between date and time, not a space[1].

[1]: https://pkg.go.dev/time#pkg-constants

Resolves: part of pelletier#613
@moorereason
Copy link
Contributor

I opened a discussion in toml-lang/toml-test#91 about valid/datetime/milliseconds and nanosecond precision.

@pelletier
Copy link
Owner Author

pelletier commented Oct 20, 2021

@moorereason Do you know if BurntSushi/toml passes the toml-test? I don't understand how it is possible with some tests such as TestTOMLTest_Valid_Float_InfAndNan that check for outputs like +inf and inf, while Go does not have unsigned infinity.

@moorereason
Copy link
Contributor

moorereason commented Oct 21, 2021

@pelletier, that's interesting. Yes, it passes the tests.

If I run the BurntSushi toml-test-decoder by hand, it outputs signed infinity values just like go-toml. So, I went digging. The toml-test suite compares JSON objects and in the process normalizes the floats to a signed value with strconv.ParseFloat (see Test.cmpFloats). In so doing, we end up comparing signed infinity values. So, the test suite doesn't do a truly byte-level comparison of the JSON output.

BurntSushi/toml runs the test suite using the toml-test API (similar to my original PR) instead of generating local tests from the test files. So, they sidestep the issue.

If the toml-test package exported Test.cmpJSON, we could potentially reuse their logic to get matching results.

@pelletier
Copy link
Owner Author

@moorereason set up this #637 until we figure out a better integration, so that we can focus on making the tests pass for go-toml/v2.

@pelletier
Copy link
Owner Author

Looks like we are down to the two Valid_String_Multiline* tests!
cc @jidicula

@jidicula
Copy link
Contributor

jidicula commented Oct 23, 2021

@pelletier sorry, I haven't had time to look at this yet and won't have time this weekend either. Anyone else can feel free to pick up those 2 remaining failing tests.

The farthest I could get for TestTOMLTest_Valid_String_MultilineQuotes is that at least with the lit_one = ''''one quote'''' subcase, the parser seems to be failing to keep the single quote portions of the string literal 'one quote'. In parseVal, with the call to p.parseMultilineLiteralString(b), the returned values are:

  • raw: ''''one quote'''
  • v: 'one quote
  • b: ''''one quote''''

@pelletier pelletier added document Issues related to Document Editing and removed document Issues related to Document Editing labels Oct 23, 2021
@pelletier
Copy link
Owner Author

pelletier commented Oct 23, 2021

@jidicula No worries at all! I'll look at other bugs first.

@pelletier
Copy link
Owner Author

All closed! Thank you everybody for all your help fixing those issues!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues describing a bug in go-toml. good first issue Issues that are suitable for first-time contributors. v2 Issues impacting the v2 major version.
Projects
None yet
Development

No branches or pull requests

4 participants