1
1
mirror of https://github.com/github/semantic.git synced 2024-12-11 20:44:37 +03:00
semantic/test/Analysis/PHP/Spec.hs

26 lines
580 B
Haskell
Raw Normal View History

2018-03-20 00:53:47 +03:00
{-# LANGUAGE OverloadedLists #-}
module Analysis.PHP.Spec (spec) where
import Data.Abstract.Value
import Data.Map
import SpecHelpers
spec :: Spec
spec = parallel $ do
describe "evalutes PHP" $ do
it "include" $ do
env <- evaluate "main.php"
2018-03-20 00:53:47 +03:00
let expectedEnv = [ (qualifiedName ["foo"], addr 0) ]
env `shouldBe` expectedEnv
where
addr = Address . Precise
fixtures = "test/fixtures/php/analysis/"
evaluate entry = snd . fst . fst . fst . fst <$>
evaluateFiles phpParser
[ fixtures <> entry
, fixtures <> "foo.php"
]