1package controllers
2
3import (
4	"testing"
5
6	"github.com/stretchr/testify/assert"
7
8	cst "repodiff/constants"
9	ent "repodiff/entities"
10	"repodiff/repositories"
11)
12
13func TestRegressionIncorrectStringValue(t *testing.T) {
14	commitRows, _ := CSVFileToCommitRows("testdata/commit.csv")
15	analyzed := make([]ent.AnalyzedCommitRow, len(commitRows))
16	for i, row := range commitRows {
17		analyzed[i] = ent.AnalyzedCommitRow{
18			CommitRow: row,
19			Type:      cst.Empty,
20		}
21	}
22
23	c, _ := repositories.NewCommitRepository(
24		ent.MappedDiffTarget{
25			UpstreamTarget:   1,
26			DownstreamTarget: 2,
27		},
28	)
29	err := c.InsertCommitRows(analyzed)
30	assert.Equal(t, nil, err, "Error should be nil")
31}
32