modify the bytereader to handler windows line ending.

This commit is contained in:
Jijie Wei
2020-07-07 00:22:06 -07:00
parent fd3a4a88be
commit 488a88ec6e
2 changed files with 35 additions and 1 deletions

View File

@@ -299,6 +299,38 @@ metadata:
SetAnnotations: map[string]string{"foo": "bar"}},
},
//
//
//
{
name: "windows_line_ending",
input: "\r\n---\r\na: b # first resource\r\nc: d\r\n---\r\n# second resource\r\ne: f\r\ng:\r\n- h\r\n---\r\n\r\n---\r\n i: j",
expectedItems: []string{
`a: b # first resource
c: d
metadata:
annotations:
foo: 'bar'
`,
`# second resource
e: f
g:
- h
metadata:
annotations:
foo: 'bar'
`,
`i: j
metadata:
annotations:
foo: 'bar'
`,
},
instance: ByteReader{
OmitReaderAnnotations: true,
SetAnnotations: map[string]string{"foo": "bar"}},
},
//
//
//