2016-07-13 22:21:18 +02:00
|
|
|
package slinguist
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
. "gopkg.in/check.v1"
|
|
|
|
)
|
|
|
|
|
|
|
|
func Test(t *testing.T) { TestingT(t) }
|
|
|
|
|
|
|
|
type TSuite struct{}
|
|
|
|
|
|
|
|
var _ = Suite(&TSuite{})
|
2016-07-18 16:20:12 +02:00
|
|
|
|
|
|
|
func (s *TSuite) TestGetLanguage(c *C) {
|
|
|
|
c.Assert(GetLanguage("foo.py", []byte{}), Equals, "Python")
|
|
|
|
c.Assert(GetLanguage("foo.m", []byte(":- module")), Equals, "Mercury")
|
|
|
|
c.Assert(GetLanguage("foo.m", []byte{}), Equals, "Other")
|
|
|
|
}
|