code.gitea.io/gitea@v1.22.3/modules/indexer/code/elasticsearch/elasticsearch_test.go (about) 1 // Copyright 2020 The Gitea Authors. All rights reserved. 2 // SPDX-License-Identifier: MIT 3 4 package elasticsearch 5 6 import ( 7 "testing" 8 9 "github.com/stretchr/testify/assert" 10 ) 11 12 func TestIndexPos(t *testing.T) { 13 startIdx, endIdx := indexPos("test index start and end", "start", "end") 14 assert.EqualValues(t, 11, startIdx) 15 assert.EqualValues(t, 24, endIdx) 16 }