1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 09:15:01 +03:00

Don’t bind the heap when we aren’t using it.

This commit is contained in:
Rob Rix 2018-06-22 15:57:12 -04:00
parent 428b5a31dc
commit 903f048889
2 changed files with 5 additions and 5 deletions

View File

@ -12,12 +12,12 @@ spec :: Spec
spec = parallel $ do
describe "PHP" $ do
it "evaluates include and require" $ do
((Right [(res, env)], heap), _) <- evaluate ["main.php"]
((Right [(res, env)], _), _) <- evaluate ["main.php"]
res `shouldBe` unit
Env.names env `shouldBe` [ "bar", "foo" ]
it "evaluates include_once and require_once" $ do
((Right [(res, env)], heap), _) <- evaluate ["main_once.php"]
((Right [(res, env)], _), _) <- evaluate ["main_once.php"]
res `shouldBe` unit
Env.names env `shouldBe` [ "bar", "foo" ]

View File

@ -18,7 +18,7 @@ spec :: Spec
spec = parallel $ do
describe "Ruby" $ do
it "evaluates require_relative" $ do
((Right [(res, env)], heap), _) <- evaluate ["main.rb", "foo.rb"]
((Right [(res, env)], _), _) <- evaluate ["main.rb", "foo.rb"]
res `shouldBe` Value.Integer (Number.Integer 1)
Env.names env `shouldContain` ["foo"]
@ -27,7 +27,7 @@ spec = parallel $ do
Env.names env `shouldContain` ["foo"]
it "evaluates load with wrapper" $ do
((res, heap), _) <- evaluate ["load-wrap.rb", "foo.rb"]
((res, _), _) <- evaluate ["load-wrap.rb", "foo.rb"]
res `shouldBe` Left (SomeExc (inject @(EnvironmentError Precise) (FreeVariable "foo")))
it "evaluates subclass" $ do
@ -38,7 +38,7 @@ spec = parallel $ do
(derefQName heap ("Bar" :| []) env >>= deNamespace) `shouldBe` Just ("Bar", ["baz", "foo", "inspect"])
it "evaluates modules" $ do
((Right [(res, env)], heap), _) <- evaluate ["modules.rb"]
((Right [(res, env)], _), _) <- evaluate ["modules.rb"]
res `shouldBe` String "\"<hello>\""
Env.names env `shouldContain` [ "Bar" ]