1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 00:12:29 +03:00

Fix tests

This commit is contained in:
joshvera 2018-04-19 13:35:45 -04:00
parent 04428df6bd
commit 984cda99d0
2 changed files with 6 additions and 6 deletions

View File

@ -37,11 +37,11 @@ spec = parallel $ do
it "subclasses" $ do it "subclasses" $ do
v <- fst <$> evaluate "subclass.py" v <- fst <$> evaluate "subclass.py"
v `shouldBe` Right (Right (Right (Right (Right (Right (pure (injValue (String "\"bar\"")))))))) v `shouldBe` Right (Right (Right (Right (Right (Right (Right (pure (injValue (String "\"bar\"")))))))))
it "handles multiple inheritance left-to-right" $ do it "handles multiple inheritance left-to-right" $ do
v <- fst <$> evaluate "multiple_inheritance.py" v <- fst <$> evaluate "multiple_inheritance.py"
v `shouldBe` Right (Right (Right (Right (Right (Right (pure (injValue (String "\"foo!\"")))))))) v `shouldBe` Right (Right (Right (Right (Right (Right (Right (pure (injValue (String "\"foo!\"")))))))))
where where
ns n = Just . Latest . Just . injValue . Namespace n ns n = Just . Latest . Just . injValue . Namespace n

View File

@ -27,12 +27,12 @@ spec = parallel $ do
it "evaluates load with wrapper" $ do it "evaluates load with wrapper" $ do
res <- evaluate "load-wrap.rb" res <- evaluate "load-wrap.rb"
fst res `shouldBe` Right (Right (Right (Right (Right (Left (SomeExc (FreeVariableError "foo"))))))) fst res `shouldBe` (Right (Right (Right (Right (Right (Right (Right [])))))))
environment (snd res) `shouldBe` [ ("Object", addr 0) ] environment (snd res) `shouldBe` [ ("Object", addr 0) ]
it "evaluates subclass" $ do it "evaluates subclass" $ do
res <- evaluate "subclass.rb" res <- evaluate "subclass.rb"
fst res `shouldBe` Right (Right (Right (Right (Right (Right (pure $ injValue (String "\"<bar>\""))))))) fst res `shouldBe` Right (Right (Right (Right (Right (Right (Right (pure $ injValue (String "\"<bar>\""))))))))
environment (snd res) `shouldBe` [ ("Bar", addr 6) environment (snd res) `shouldBe` [ ("Bar", addr 6)
, ("Foo", addr 3) , ("Foo", addr 3)
, ("Object", addr 0) ] , ("Object", addr 0) ]
@ -44,13 +44,13 @@ spec = parallel $ do
it "evaluates modules" $ do it "evaluates modules" $ do
res <- evaluate "modules.rb" res <- evaluate "modules.rb"
fst res `shouldBe` Right (Right (Right (Right (Right (Right (pure $ injValue (String "\"<hello>\""))))))) fst res `shouldBe` Right (Right (Right (Right (Right (Right (Right (pure $ injValue (String "\"<hello>\""))))))))
environment (snd res) `shouldBe` [ ("Object", addr 0) environment (snd res) `shouldBe` [ ("Object", addr 0)
, ("Bar", addr 3) ] , ("Bar", addr 3) ]
it "has prelude" $ do it "has prelude" $ do
res <- fst <$> evaluate "preluded.rb" res <- fst <$> evaluate "preluded.rb"
res `shouldBe` Right (Right (Right (Right (Right (Right (pure $ injValue (String "\"<foo>\""))))))) res `shouldBe` Right (Right (Right (Right (Right (Right (Right (pure $ injValue (String "\"<foo>\""))))))))
where where
ns n = Just . Latest . Just . injValue . Namespace n ns n = Just . Latest . Just . injValue . Namespace n