Selaa lähdekoodia

add failing test cases

Songmu 11 vuotta sitten
vanhempi
commit
43a0256bb2
1 muutettua tiedostoa jossa 10 lisäystä ja 0 poistoa
  1. 10 0
      encode_test.go

+ 10 - 0
encode_test.go

@@ -306,6 +306,16 @@ var marshalTests = []struct {
 		map[string]string{"a": "b: c"},
 		map[string]string{"a": "b: c"},
 		"a: 'b: c'\n",
 		"a: 'b: c'\n",
 	},
 	},
+
+	// Containing hash mark ('#') in string should be quoted
+	{
+		map[string]string{"a": "Hello #comment"},
+		"a: 'Hello #comment'\n",
+	},
+	{
+		map[string]string{"a": "你好 #comment"},
+		"a: '你好 #comment'\n",
+	},
 }
 }
 
 
 func (s *S) TestMarshal(c *C) {
 func (s *S) TestMarshal(c *C) {