Files

17 lines
358 B
Go
Raw Permalink Normal View History

2023-06-23 20:37:56 +08:00
// 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) {
2024-10-11 20:35:04 -03:00
startIdx, endIdx := contentMatchIndexPos("test index start and end", "start", "end")
2025-03-31 07:53:48 +02:00
assert.Equal(t, 11, startIdx)
assert.Equal(t, 15, endIdx)
2023-06-23 20:37:56 +08:00
}