1
1
mirror of https://github.com/github/semantic.git synced 2024-12-30 02:14:20 +03:00
semantic/test/Data/Language/Spec.hs

20 lines
1.1 KiB
Haskell
Raw Normal View History

2019-08-19 20:34:55 +03:00
module Data.Language.Spec (testTree) where
2019-08-16 01:48:17 +03:00
import Data.Language
2019-08-19 20:34:55 +03:00
import Test.Tasty
import Test.Tasty.HUnit
2019-08-16 01:48:17 +03:00
2019-08-19 20:34:55 +03:00
testTree :: TestTree
testTree = testGroup "Data.Language"
[ testCase "supportedExts returns expected list" $
2019-10-10 00:21:59 +03:00
supportedExts @=? [".go",".java",".rb",".builder",".eye",".fcgi",".gemspec",".god",".jbuilder",".mspec",".pluginspec",".podspec",".rabl",".rake",".rbuild",".rbw",".rbx",".ru",".ruby",".spec",".thor",".watchr",".py",".bzl",".cgi",".fcgi",".gyp",".gypi",".lmi",".py3",".pyde",".pyi",".pyp",".pyt",".pyw",".rpy",".spec",".tac",".wsgi",".xpy",".js","._js",".bones",".es",".es6",".frag",".gs",".jake",".jsb",".jscad",".jsfl",".jsm",".jss",".mjs",".njs",".pac",".sjs",".ssjs",".xsjs",".xsjslib",".ts",".php",".aw",".ctp",".fcgi",".inc",".php3",".php4",".php5",".phps",".phpt"]
2019-08-19 20:34:55 +03:00
, testCase "codeNavLanguages returns expected list" $
2019-10-10 00:21:59 +03:00
codeNavLanguages @=? [Go, Java, Ruby, Python, JavaScript, TypeScript, PHP]
, testCase "languageForFilePath works for languages with ambiguous lingo extensions" $ do
languageForFilePath "foo.php" @=? PHP
languageForFilePath "foo.md" @=? Markdown
languageForFilePath "foo.tsx" @=? TSX
2019-08-19 20:34:55 +03:00
]