mirror of
https://github.com/goccy/go-yaml.git
synced 2025-12-08 06:09:57 +00:00
Make UseSingleQuote compliant with the YAML spec (#647)
* Make UseSingleQuote compliant with the YAML spec * Make it self-explanatory
This commit is contained in:
parent
3992548fbe
commit
13e918a61d
2 changed files with 20 additions and 3 deletions
|
|
@ -704,7 +704,7 @@ func TestEncoder(t *testing.T) {
|
|||
},
|
||||
// Quote style
|
||||
{
|
||||
`v: '\'a\'b'` + "\n",
|
||||
`v: '''a''b'` + "\n",
|
||||
map[string]string{"v": `'a'b`},
|
||||
[]yaml.EncodeOption{
|
||||
yaml.UseSingleQuote(true),
|
||||
|
|
@ -717,6 +717,13 @@ func TestEncoder(t *testing.T) {
|
|||
yaml.UseSingleQuote(false),
|
||||
},
|
||||
},
|
||||
{
|
||||
`a: '\.yaml'` + "\n",
|
||||
map[string]string{"a": `\.yaml`},
|
||||
[]yaml.EncodeOption{
|
||||
yaml.UseSingleQuote(true),
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
t.Run(test.source, func(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue