MCPcopy
hub / github.com/micro-editor/micro / TestJoin

Function TestJoin

internal/buffer/line_array_test.go:33–41  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

31}
32
33func TestJoin(t *testing.T) {
34 la.remove(Loc{47, 1}, Loc{0, 2})
35 assert.Equal(t, len(la.lines), 5)
36 sub := la.Substr(Loc{0, 1}, Loc{47, 1})
37 bytes := la.Bytes()
38
39 assert.Equal(t, []byte("He wes Leovenaðes sone -- liðe him be Drihten."), sub)
40 assert.Equal(t, unicode_txt, string(bytes))
41}
42
43func TestInsert(t *testing.T) {
44 la.insert(Loc{20, 3}, []byte(" foobar"))

Callers

nothing calls this directly

Calls 3

SubstrMethod · 0.80
BytesMethod · 0.80
removeMethod · 0.45

Tested by

no test coverage detected