summaryrefslogtreecommitdiffstats
path: root/modules/indexer/code/elasticsearch/elasticsearch_test.go
blob: c6ba93e76d4695a1ebd2831afb2dbfacfc4217d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Copyright 2020 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT

package elasticsearch

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestIndexPos(t *testing.T) {
	startIdx, endIdx := indexPos("test index start and end", "start", "end")
	assert.EqualValues(t, 11, startIdx)
	assert.EqualValues(t, 24, endIdx)
}