MCPcopy Index your code
hub / github.com/micro-editor/micro / TestInsert

Function TestInsert

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

Source from the content-addressed store, hash-verified

41}
42
43func TestInsert(t *testing.T) {
44 la.insert(Loc{20, 3}, []byte(" foobar"))
45 sub1 := la.Substr(Loc{0, 3}, Loc{50, 3})
46
47 assert.Equal(t, []byte("Uppen Sevarne staþe, foobar sel þar him þuhte,"), sub1)
48
49 la.insert(Loc{25, 2}, []byte("H̼̥̯͇͙̕͘͞e̸̦̞̠̣̰͙̼̥̦̼̖̬͕͕̰̯̫͇̕ĺ̜̠̩̯̯͙̼̭̠͕̮̞͜l̶͓̫̞̮͈͞ͅo̸͔͙̳̠͈̮̼̳͙̥̲͜͠"))
50
51 sub2 := la.Substr(Loc{0, 2}, Loc{60, 2})
52 assert.Equal(t, []byte("He wonede at Ernleȝe at æH̼̥̯͇͙̕͘͞e̸̦̞̠̣̰͙̼̥̦̼̖̬͕͕̰̯̫͇̕ĺ̜̠̩̯̯͙̼̭̠͕̮̞͜l̶͓̫̞̮͈͞ͅo̸͔͙̳̠͈̮̼̳͙̥̲͜͠ðelen are chirechen,"), sub2)
53}
54
55func TestRemove(t *testing.T) {
56 la.remove(Loc{20, 3}, Loc{27, 3})

Callers

nothing calls this directly

Calls 2

SubstrMethod · 0.80
insertMethod · 0.45

Tested by

no test coverage detected