data: fix getting the first line for empty content

Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
This commit is contained in:
Miguel Molina
2020-05-28 11:22:58 +02:00
parent e1f1b57a84
commit 79398a925d
2 changed files with 18 additions and 2 deletions

View File

@ -8,6 +8,10 @@ import (
"github.com/stretchr/testify/require"
)
func TestGetFirstLineEmptyContent(t *testing.T) {
require.Nil(t, getFirstLine(nil))
}
func TestForEachLine(t *testing.T) {
const sample = "foo\nbar\nboomboom\nbleepbloop\n"
var lines = strings.Split(sample, "\n")