mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 17:05:18 +00:00
b76b23e6ee
Fixes #2245
26 lines
391 B
Go
26 lines
391 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestSplitYaml(t *testing.T) {
|
|
in := `
|
|
---
|
|
- Document
|
|
#---
|
|
--- Document2
|
|
---
|
|
Document3
|
|
`
|
|
|
|
docs := splitYaml(in)
|
|
require.Equal(t, 3, len(docs))
|
|
assert.Equal(t, "- Document\n#---", docs[0])
|
|
assert.Equal(t, "Document2", docs[1])
|
|
assert.Equal(t, "Document3", docs[2])
|
|
}
|