aboutsummaryrefslogtreecommitdiffstats
path: root/modules/indexer/code/elasticsearch/elasticsearch_test.go
blob: e8f1f202ce089cb80046903c66ee9818fc5d01cc (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 := contentMatchIndexPos("test index start and end", "start", "end")
	assert.Equal(t, 11, startIdx)
	assert.Equal(t, 15, endIdx)
}