blob: 8980d8cb94734a097f91de279f7255882a0718c5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
//go:build test
package pikdex
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestContentLines(t *testing.T) {
in := `asdf
hjkl`
result := contentLines(in)
assert.Equal(t, []string{"asdf", "hjkl"}, result)
}
func TestContentLines_EmptyLine(t *testing.T) {
in := `asdf
hjkl`
result := contentLines(in)
assert.Equal(t, []string{"asdf", "hjkl"}, result)
}
func TestContentLines_Empty(t *testing.T) {
in := ``
result := contentLines(in)
assert.Len(t, result, 0)
}
func TestContentLines_Comment(t *testing.T) {
in := `
//aaa
asdf
# iuyyiuoui
hjkl`
result := contentLines(in)
assert.Equal(t, []string{"asdf", "hjkl"}, result)
}
|