Return group color if language has none

This commit is contained in:
Lauris BH
2020-03-21 15:37:39 +02:00
parent cfaa7a1711
commit 97a26011a9
13 changed files with 293 additions and 1 deletions

View File

@ -88,6 +88,11 @@ var (
colorsGold = filepath.Join(testDir, "colors.gold")
colorsTestTmplPath = filepath.Join(assetsDir, "colors.go.tmpl")
colorsTestTmplName = "colors.go.tmpl"
// colors test
groupsGold = filepath.Join(testDir, "groups.gold")
groupsTestTmplPath = filepath.Join(assetsDir, "groups.go.tmpl")
groupsTestTmplName = "groups.go.tmpl"
)
type GeneratorTestSuite struct {
@ -261,6 +266,16 @@ func (s *GeneratorTestSuite) SetupSuite() {
generate: Colors,
wantOut: colorsGold,
},
{
name: "Groups()",
fileToParse: filepath.Join(s.tmpLinguist, languagesFile),
samplesDir: "",
tmplPath: groupsTestTmplPath,
tmplName: groupsTestTmplName,
commit: commit,
generate: Groups,
wantOut: groupsGold,
},
}
}