1
1
mirror of https://github.com/github/semantic.git synced 2025-01-05 22:28:10 +03:00
semantic/test/Analysis/PHP/Spec.hs
2018-03-19 14:53:47 -07:00

26 lines
580 B
Haskell

{-# 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"
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"
]