MCPcopy Create free account
hub / github.com/cogentcore/core / getall

Function getall

texteditor/difflib/bytes/bytes_test.go:241–260  ·  view source on GitHub ↗
(b2j *B2J, lt lineType)

Source from the content-addressed store, hash-verified

239}
240
241func getall(b2j *B2J, lt lineType) [][]byte {
242 result := []int{}
243 for _, slots := range b2j.store {
244 for _, slot := range slots {
245 slt := lineNORMAL
246 if len(slot) == 2 && slot[1] < 0 {
247 slt = lineType(slot[1])
248 }
249 if lt == slt {
250 result = append(result, slot[0])
251 }
252 }
253 }
254 sort.Ints(result)
255 lines := make([][]byte, len(result))
256 for i, lineno := range result {
257 lines[i] = b2j.b[lineno]
258 }
259 return lines
260}
261
262func TestWithAsciiOneInsert(t *testing.T) {
263 sm := NewMatcher(splitChars(rep("b", 100)),

Callers 2

TestWithAsciiOneInsertFunction · 0.85
TestWithAsciiBJunkFunction · 0.85

Calls 1

lineTypeTypeAlias · 0.85

Tested by

no test coverage detected