Decode: allow \r\n as line whitespace before \ (#709)

Fixes #708
This commit is contained in:
Thomas Pelletier
2021-12-26 16:38:15 +01:00
committed by GitHub
parent 5cbdea6192
commit 177b4a5e53
2 changed files with 11 additions and 0 deletions
+7
View File
@@ -2304,6 +2304,13 @@ func TestIssue703(t *testing.T) {
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) {
examples := []struct {
desc string