File: index_test.go

package info (click to toggle)
golang-github-sergi-go-diff 1.4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,324 kB
  • sloc: makefile: 38; sh: 15
file content (16 lines) | stat: -rw-r--r-- 351 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package diffmatchpatch

import (
	"github.com/stretchr/testify/assert"
	"testing"
)

func TestIndexConversion(t *testing.T) {
	n := runeMax - (runeSkipEnd - runeSkipStart)
	indexes := make([]index, n)
	for i := 0; i < n; i++ {
		indexes[i] = index(i)
	}
	indexes2 := stringToIndex(indexesToString(indexes))
	assert.EqualValues(t, indexes, indexes2)
}