Sfoglia il codice sorgente

Add trivial test for cr-lf endings.

Gustavo Niemeyer 6 anni fa
parent
commit
674ba3eaed
1 ha cambiato i file con 11 aggiunte e 2 eliminazioni
  1. 11 2
      decode_test.go

+ 11 - 2
decode_test.go

@@ -773,11 +773,20 @@ var unmarshalTests = []struct {
 	{
 		"true\n#" + strings.Repeat(" ", 512*3),
 		"true",
-	},
-	{
+	}, {
 		"true #" + strings.Repeat(" ", 512*3),
 		"true",
 	},
+
+	// CRLF
+	{
+		"a: b\r\nc:\r\n- d\r\n- e\r\n",
+		map[string]interface{}{
+			"a": "b",
+			"c": []interface{}{"d", "e"},
+		},
+	},
+
 }
 
 type M map[string]interface{}