mirror of
https://github.com/ralsina/tartrazine.git
synced 2024-11-10 13:32:24 +00:00
27 lines
736 B
Go
27 lines
736 B
Go
package slinguist
|
|
|
|
import . "gopkg.in/check.v1"
|
|
|
|
func (s *TSuite) TestGetLanguageByAlias(c *C) {
|
|
tests := []struct {
|
|
alias string
|
|
expectedLang string
|
|
}{
|
|
{alias: "BestLanguageEver", expectedLang: OtherLanguage},
|
|
{alias: "aspx-vb", expectedLang: "ASP"},
|
|
{alias: "C++", expectedLang: "C++"},
|
|
{alias: "c++", expectedLang: "C++"},
|
|
{alias: "objc", expectedLang: "Objective-C"},
|
|
{alias: "golang", expectedLang: "Go"},
|
|
{alias: "GOLANG", expectedLang: "Go"},
|
|
{alias: "bsdmake", expectedLang: "Makefile"},
|
|
{alias: "xhTmL", expectedLang: "HTML"},
|
|
{alias: "python", expectedLang: "Python"},
|
|
}
|
|
|
|
for _, test := range tests {
|
|
lang := GetLanguageByAlias(test.alias)
|
|
c.Assert(lang, Equals, test.expectedLang)
|
|
}
|
|
}
|