Kaynağa Gözat

Add test ensuring ": " values get quoted.

This was reported as PR #43, but is not reproducible.
Gustavo Niemeyer 11 yıl önce
ebeveyn
işleme
71e7ede9d4
1 değiştirilmiş dosya ile 6 ekleme ve 0 silme
  1. 6 0
      encode_test.go

+ 6 - 0
encode_test.go

@@ -286,6 +286,12 @@ var marshalTests = []struct {
 		map[string]net.IP{"a": net.IPv4(1, 2, 3, 4)},
 		"a: 1.2.3.4\n",
 	},
+
+	// Ensure strings containing ": " are quoted (reported as PR #43, but not reproducible).
+	{
+		map[string]string{"a": "b: c"},
+		"a: 'b: c'\n",
+	},
 }
 
 func (s *S) TestMarshal(c *C) {