summaryrefslogtreecommitdiff
path: root/indexers/pikdex/meta_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'indexers/pikdex/meta_test.go')
-rw-r--r--indexers/pikdex/meta_test.go39
1 files changed, 39 insertions, 0 deletions
diff --git a/indexers/pikdex/meta_test.go b/indexers/pikdex/meta_test.go
new file mode 100644
index 0000000..e04815f
--- /dev/null
+++ b/indexers/pikdex/meta_test.go
@@ -0,0 +1,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, "asdf", "hjkl", result)
+}
+
+func TestContentLines_EmptyLine(t *testing.T) {
+ in := `asdf
+
+hjkl`
+ result := contentLines(in)
+ assert.Equal(t, "asdf", "hjkl", result)
+}
+
+func TestContentLines_Empty(t *testing.T) {
+ in := ``
+ result := contentLines(in)
+ assert.Equal(t, nil, result)
+}
+
+func TestContentLines_Comment(t *testing.T) {
+ in := `
+//aaa
+asdf
+# iuyyiuoui
+hjkl`
+ result := contentLines(in)
+ assert.Equal(t, "asdf", "hjkl", result)
+}