mirror of
https://github.com/goccy/go-yaml.git
synced 2025-11-02 14:21:07 +00:00
Quote YAML 1.1 bools at encoding time for compatibility with other legacy parsers (#354)
This commit is contained in:
parent
11ad39b5c5
commit
f3319d6c80
4 changed files with 56 additions and 6 deletions
|
|
@ -440,7 +440,7 @@ func TestEncoder(t *testing.T) {
|
|||
},
|
||||
|
||||
{
|
||||
"a:\n y: \"\"\n",
|
||||
"a:\n \"y\": \"\"\n",
|
||||
struct {
|
||||
A *struct {
|
||||
X string `yaml:"x,omitempty"`
|
||||
|
|
@ -702,7 +702,7 @@ func TestEncodeStructIncludeMap(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatalf("%+v", err)
|
||||
}
|
||||
expect := "a:\n m:\n x: y\n"
|
||||
expect := "a:\n m:\n x: \"y\"\n"
|
||||
actual := string(bytes)
|
||||
if actual != expect {
|
||||
t.Fatalf("unexpected output. expect:[%s] actual:[%s]", expect, actual)
|
||||
|
|
@ -720,7 +720,7 @@ func TestEncodeDefinedTypeKeyMap(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatalf("%+v", err)
|
||||
}
|
||||
expect := "m:\n x: y\n"
|
||||
expect := "m:\n x: \"y\"\n"
|
||||
actual := string(bytes)
|
||||
if actual != expect {
|
||||
t.Fatalf("unexpected output. expect:[%s] actual:[%s]", expect, actual)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue