mirror of
https://github.com/ralsina/tartrazine.git
synced 2024-11-13 23:12:24 +00:00
23 lines
598 B
Go
23 lines
598 B
Go
package slinguist
|
|
|
|
import . "gopkg.in/check.v1"
|
|
|
|
func (s *TSuite) TestGetLanguageByExtension(c *C) {
|
|
lang, safe := GetLanguageByExtension("foo.foo")
|
|
c.Assert(lang, Equals, "Other")
|
|
c.Assert(safe, Equals, false)
|
|
|
|
lang, safe = GetLanguageByExtension("foo.go")
|
|
c.Assert(lang, Equals, "Go")
|
|
c.Assert(safe, Equals, true)
|
|
|
|
lang, safe = GetLanguageByExtension("foo.go.php")
|
|
c.Assert(lang, Equals, "Hack")
|
|
c.Assert(safe, Equals, false)
|
|
}
|
|
|
|
func (s *TSuite) TestGetLanguageExtensions(c *C) {
|
|
c.Assert(GetLanguageExtensions("foo"), HasLen, 0)
|
|
c.Assert(GetLanguageExtensions("C"), Not(HasLen), 0)
|
|
}
|