Add more tests around yaml parsing.

This commit is contained in:
jregan
2020-11-24 14:15:45 -08:00
parent 0d030e3095
commit 1eb378254a
6 changed files with 398 additions and 25 deletions

View File

@@ -85,6 +85,14 @@ func ParseAll(inputs ...string) ([]*yaml.RNode, error) {
}).Read()
}
// FromBytes reads from a byte slice.
func FromBytes(bs []byte) ([]*yaml.RNode, error) {
return (&ByteReader{
OmitReaderAnnotations: true,
Reader: bytes.NewBuffer(bs),
}).Read()
}
// StringAll writes all of the resources to a string
func StringAll(resources []*yaml.RNode) (string, error) {
var b bytes.Buffer