MCPcopy
hub / github.com/harness/harness / Test_readTextFileNoLineEnding

Function Test_readTextFileNoLineEnding

git/parser/text_test.go:47–61  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

45}
46
47func Test_readTextFileNoLineEnding(t *testing.T) {
48 scanner, le, err := ReadTextFile(bytes.NewReader([]byte("abc")), nil)
49 assert.NoError(t, err)
50 assert.Equal(t, "\n", le)
51
52 ok := scanner.Scan()
53 assert.True(t, ok)
54 assert.NoError(t, scanner.Err())
55 assert.Equal(t, "abc", scanner.Text())
56
57 ok = scanner.Scan()
58 assert.False(t, ok)
59 assert.NoError(t, scanner.Err())
60 assert.Nil(t, scanner.Bytes())
61}
62
63func Test_readTextFileLineEndingLF(t *testing.T) {
64 scanner, le, err := ReadTextFile(bytes.NewReader([]byte("abc\n")), nil)

Callers

nothing calls this directly

Calls 6

ReadTextFileFunction · 0.85
EqualMethod · 0.80
ScanMethod · 0.65
ErrMethod · 0.65
TextMethod · 0.65
BytesMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…