@@ -578,6 +578,10 @@ func (p *parser) parseMultilineBasicString(b []byte) ([]byte, []byte, []byte, er
|
|||||||
switch token[i+j] {
|
switch token[i+j] {
|
||||||
case ' ', '\t':
|
case ' ', '\t':
|
||||||
continue
|
continue
|
||||||
|
case '\r':
|
||||||
|
if token[i+j+1] == '\n' {
|
||||||
|
continue
|
||||||
|
}
|
||||||
case '\n':
|
case '\n':
|
||||||
isLastNonWhitespaceOnLine = true
|
isLastNonWhitespaceOnLine = true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2304,6 +2304,13 @@ func TestIssue703(t *testing.T) {
|
|||||||
require.Error(t, err)
|
require.Error(t, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestIssue708(t *testing.T) {
|
||||||
|
v := map[string]string{}
|
||||||
|
err := toml.Unmarshal([]byte("0=\"\"\"\\\r\n\"\"\""), &v)
|
||||||
|
require.NoError(t, err)
|
||||||
|
require.Equal(t, map[string]string{"0": ""}, v)
|
||||||
|
}
|
||||||
|
|
||||||
func TestUnmarshalDecodeErrors(t *testing.T) {
|
func TestUnmarshalDecodeErrors(t *testing.T) {
|
||||||
examples := []struct {
|
examples := []struct {
|
||||||
desc string
|
desc string
|
||||||
|
|||||||
Reference in New Issue
Block a user