Implement getting color code for languages

Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>
This commit is contained in:
Lauris Bukšis-Haberkorns
2019-07-19 23:28:57 +03:00
parent 6ccf0b6bd1
commit 25b29ebdc4
12 changed files with 611 additions and 0 deletions

View File

@ -80,6 +80,11 @@ const (
mimeTypeGold = testDir + "/mimeType.gold"
mimeTypeTestTmplPath = assetsDir + "/mimeType.go.tmpl"
mimeTypeTestTmplName = "mimeType.go.tmpl"
// colors test
colorsGold = testDir + "/colors.gold"
colorsTestTmplPath = assetsDir + "/colors.go.tmpl"
colorsTestTmplName = "colors.go.tmpl"
)
type GeneratorTestSuite struct {
@ -243,6 +248,16 @@ func (s *GeneratorTestSuite) SetupSuite() {
generate: MimeType,
wantOut: mimeTypeGold,
},
{
name: "Colors()",
fileToParse: filepath.Join(s.tmpLinguist, languagesFile),
samplesDir: "",
tmplPath: colorsTestTmplPath,
tmplName: colorsTestTmplName,
commit: commit,
generate: Colors,
wantOut: colorsGold,
},
}
}