@@ -29,53 +29,53 @@ spec = parallel $ do
2929 (scopeGraph, (heap, res)) <- evaluate [" main6.ts" , " baz.ts" , " foo.ts" ]
3030 case ModuleTable. lookup " main6.ts" <$> res of
3131 Right (Just (Module _ (scopeAndFrame, _))) -> do
32- () <$ SpecHelpers. lookupDeclaration " foo" scopeAndFrame heap scopeGraph `shouldBe` Just ()
32+ SpecHelpers. lookupDeclaration " foo" scopeAndFrame heap scopeGraph `shouldSatisfy` isJust
3333 other -> expectationFailure (show other)
3434
3535 it " imports with aliased symbols" $ do
3636 (scopeGraph, (heap, res)) <- evaluate [" main.ts" , " foo.ts" , " foo/b.ts" ]
3737 case ModuleTable. lookup " main.ts" <$> res of
3838 Right (Just (Module _ (scopeAndFrame, _))) -> do
39- () <$ SpecHelpers. lookupDeclaration " bar" scopeAndFrame heap scopeGraph `shouldBe` Just ()
40- () <$ SpecHelpers. lookupDeclaration " quz" scopeAndFrame heap scopeGraph `shouldBe` Just ()
39+ SpecHelpers. lookupDeclaration " bar" scopeAndFrame heap scopeGraph `shouldSatisfy` isJust
40+ SpecHelpers. lookupDeclaration " quz" scopeAndFrame heap scopeGraph `shouldSatisfy` isJust
4141
4242 other -> expectationFailure (show other)
4343
4444 it " imports with qualified names" $ do
4545 (scopeGraph, (heap, res)) <- evaluate [" main1.ts" , " foo.ts" , " a.ts" ]
4646 case ModuleTable. lookup " main1.ts" <$> res of
4747 Right (Just (Module _ (scopeAndFrame, _))) -> do
48- () <$ SpecHelpers. lookupDeclaration " b" scopeAndFrame heap scopeGraph `shouldBe` Just ()
49- () <$ SpecHelpers. lookupDeclaration " z" scopeAndFrame heap scopeGraph `shouldBe` Just ()
48+ SpecHelpers. lookupDeclaration " b" scopeAndFrame heap scopeGraph `shouldSatisfy` isJust
49+ SpecHelpers. lookupDeclaration " z" scopeAndFrame heap scopeGraph `shouldSatisfy` isJust
5050
5151 lookupMembers " b" Import scopeAndFrame heap scopeGraph `shouldBe` Just [ " baz" , " foo" ]
5252 lookupMembers " z" Import scopeAndFrame heap scopeGraph `shouldBe` Just [ " baz" , " foo" ]
5353
54- () <$ SpecHelpers. lookupDeclaration " baz" scopeAndFrame heap scopeGraph `shouldBe` Nothing
55- () <$ SpecHelpers. lookupDeclaration " foo" scopeAndFrame heap scopeGraph `shouldBe` Nothing
54+ SpecHelpers. lookupDeclaration " baz" scopeAndFrame heap scopeGraph `shouldBe` Nothing
55+ SpecHelpers. lookupDeclaration " foo" scopeAndFrame heap scopeGraph `shouldBe` Nothing
5656 other -> expectationFailure (show other)
5757
5858 it " stores function declaration in scope graph" $ do
5959 (scopeGraph, (heap, res)) <- evaluate [" a.ts" ]
6060 case ModuleTable. lookup " a.ts" <$> res of
6161 Right (Just (Module _ (scopeAndFrame, value))) -> do
62- () <$ SpecHelpers. lookupDeclaration " baz" scopeAndFrame heap scopeGraph `shouldBe` Just ()
62+ SpecHelpers. lookupDeclaration " baz" scopeAndFrame heap scopeGraph `shouldSatisfy` isJust
6363 value `shouldBe` Unit
6464 other -> expectationFailure (show other)
6565
6666 it " imports functions" $ do
6767 (scopeGraph, (heap, res)) <- evaluate [" main4.ts" , " foo.ts" ]
6868 case ModuleTable. lookup " main4.ts" <$> res of
6969 Right (Just (Module _ (scopeAndFrame, value))) -> do
70- () <$ SpecHelpers. lookupDeclaration " foo" scopeAndFrame heap scopeGraph `shouldBe` Just ()
70+ SpecHelpers. lookupDeclaration " foo" scopeAndFrame heap scopeGraph `shouldSatisfy` isJust
7171 value `shouldBe` String (pack " \" this is the foo function\" " )
7272 other -> expectationFailure (show other)
7373
7474 it " side effect only imports dont expose exports" $ do
7575 (scopeGraph, (heap, res)) <- evaluate [" main3.ts" , " a.ts" ]
7676 case ModuleTable. lookup " main3.ts" <$> res of
7777 Right (Just (Module _ (scopeAndFrame, value))) -> do
78- () <$ SpecHelpers. lookupDeclaration " baz" scopeAndFrame heap scopeGraph `shouldBe` Nothing
78+ SpecHelpers. lookupDeclaration " baz" scopeAndFrame heap scopeGraph `shouldBe` Nothing
7979 value `shouldBe` Unit
8080 Heap. heapSize heap `shouldBe` 4
8181 other -> expectationFailure (show other)
@@ -88,7 +88,7 @@ spec = parallel $ do
8888 (scopeGraph, (heap, res)) <- evaluate [" early-return.ts" ]
8989 case ModuleTable. lookup " early-return.ts" <$> res of
9090 Right (Just (Module _ (scopeAndFrame, _))) ->
91- () <$ SpecHelpers. lookupDeclaration " foo" scopeAndFrame heap scopeGraph `shouldBe` Just ()
91+ SpecHelpers. lookupDeclaration " foo" scopeAndFrame heap scopeGraph `shouldSatisfy` isJust
9292 other -> expectationFailure (show other)
9393
9494 it " evaluates sequence expressions" $ do
@@ -117,7 +117,7 @@ spec = parallel $ do
117117 case ModuleTable. lookup " await.ts" <$> res of
118118 Right (Just (Module _ (scopeAndFrame, _))) -> do
119119 -- Test that f2 is in the scopegraph and heap.
120- () <$ SpecHelpers. lookupDeclaration " f2" scopeAndFrame heap scopeGraph `shouldBe` Just ()
120+ SpecHelpers. lookupDeclaration " f2" scopeAndFrame heap scopeGraph `shouldSatisfy` isJust
121121 -- Test we can't reference y from outside the function
122122 SpecHelpers. lookupDeclaration " y" scopeAndFrame heap scopeGraph `shouldBe` Nothing
123123 other -> expectationFailure (show other)
0 commit comments