initial import
This commit is contained in:
24
core/iox/textlinescanner_test.go
Normal file
24
core/iox/textlinescanner_test.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package iox
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestScanner(t *testing.T) {
|
||||
const val = `1
|
||||
2
|
||||
3
|
||||
4`
|
||||
reader := strings.NewReader(val)
|
||||
scanner := NewTextLineScanner(reader)
|
||||
var lines []string
|
||||
for scanner.Scan() {
|
||||
line, err := scanner.Line()
|
||||
assert.Nil(t, err)
|
||||
lines = append(lines, line)
|
||||
}
|
||||
assert.EqualValues(t, []string{"1", "2", "3", "4"}, lines)
|
||||
}
|
||||
Reference in New Issue
Block a user