Skip to content

Commit

Permalink
chore: add multiline string tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JanDeDobbeleer committed Oct 12, 2023
1 parent af4979d commit 37d351c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions decode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,14 @@ func TestDecoder(t *testing.T) {
"v: |\n hello\n ...\n world\n",
map[string]string{"v": "hello\n...\nworld\n"},
},
{
"v: >\n hello\n ...\n world\n",
map[string]string{"v": "hello ... world"},
},
{
"v: \"hello\n ...\n world\n\"",
map[string]string{"v": "hello ... world "},
},
{
"a: !!binary gIGC\n",
map[string]string{"a": "\x80\x81\x82"},
Expand Down Expand Up @@ -2638,8 +2646,8 @@ func TestDecoder_LiteralWithNewLine(t *testing.T) {

func TestDecoder_TabCharacterAtRight(t *testing.T) {
yml := `
- a: [2 , 2]
b: [2 , 2]
- a: [2 , 2]
b: [2 , 2]
c: [2 , 2]`
var v []map[string][]int
if err := yaml.Unmarshal([]byte(yml), &v); err != nil {
Expand Down

0 comments on commit 37d351c

Please sign in to comment.