Bugfix for unicode characters in commit message

Test: Regression tests included

Change-Id: I92d4bc0a2962d8dd9d9a3c6fde53d7fbd37891e2
This commit is contained in:
Scott Lobdell
2018-04-30 12:47:43 -07:00
parent 5849febc17
commit ed2b3e1565
7 changed files with 89 additions and 9 deletions

View File

@@ -0,0 +1,31 @@
package controllers
import (
"testing"
"github.com/stretchr/testify/assert"
cst "repodiff/constants"
ent "repodiff/entities"
"repodiff/repositories"
)
func TestRegressionIncorrectStringValue(t *testing.T) {
commitRows, _ := CSVFileToCommitRows("testdata/commit.csv")
analyzed := make([]ent.AnalyzedCommitRow, len(commitRows))
for i, row := range commitRows {
analyzed[i] = ent.AnalyzedCommitRow{
CommitRow: row,
Type: cst.Empty,
}
}
c, _ := repositories.NewCommitRepository(
ent.MappedDiffTarget{
UpstreamTarget: 1,
DownstreamTarget: 2,
},
)
err := c.InsertCommitRows(analyzed)
assert.Equal(t, nil, err, "Error should be nil")
}