Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit 02e56c9

Browse files
authored
Merge pull request #157 from jhrcek/fix-test-warnings
Fix warnings in tests
2 parents 41b956e + 93cb2d3 commit 02e56c9

File tree

16 files changed

+44
-43
lines changed

16 files changed

+44
-43
lines changed

test/Analysis/PHP/Spec.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ spec = parallel $ do
3232
xit "evaluates namespaces" $ do
3333
(scopeGraph, (heap, res)) <- evaluate ["namespaces.php"]
3434
case ModuleTable.lookup "namespaces.php" <$> res of
35-
Right (Just (Module _ (scopeAndFrame, value))) -> do
35+
Right (Just (Module _ (scopeAndFrame, _))) -> do
3636
const () <$> SpecHelpers.lookupDeclaration "Foo" scopeAndFrame heap scopeGraph `shouldBe` Just ()
3737
const () <$> SpecHelpers.lookupDeclaration "NS1" scopeAndFrame heap scopeGraph `shouldBe` Just ()
3838

test/Analysis/Python/Spec.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ spec = parallel $ do
2727
it "imports with aliases" $ do
2828
(scopeGraph, (heap, res)) <- evaluate ["main1.py", "a.py", "b/__init__.py", "b/c.py"]
2929
case ModuleTable.lookup "main1.py" <$> res of
30-
Right (Just (Module _ (scopeAndFrame, value))) -> do
30+
Right (Just (Module _ (scopeAndFrame, _))) -> do
3131
const () <$> SpecHelpers.lookupDeclaration "b" scopeAndFrame heap scopeGraph `shouldBe` Just ()
3232
const () <$> SpecHelpers.lookupDeclaration "e" scopeAndFrame heap scopeGraph `shouldBe` Just ()
3333
other -> expectationFailure (show other)
3434

3535
it "imports using from syntax" $ do
3636
(scopeGraph, (heap, res)) <- evaluate ["main2.py", "a.py", "b/__init__.py", "b/c.py"]
3737
case ModuleTable.lookup "main2.py" <$> res of
38-
Right (Just (Module _ (scopeAndFrame, value))) -> do
38+
Right (Just (Module _ (scopeAndFrame, _))) -> do
3939
const () <$> SpecHelpers.lookupDeclaration "bar" scopeAndFrame heap scopeGraph `shouldBe` Just ()
4040
const () <$> SpecHelpers.lookupDeclaration "foo" scopeAndFrame heap scopeGraph `shouldBe` Just ()
4141

@@ -46,7 +46,7 @@ spec = parallel $ do
4646
it "imports with relative syntax" $ do
4747
(scopeGraph, (heap, res)) <- evaluate ["main3.py", "c/__init__.py", "c/utils.py"]
4848
case ModuleTable.lookup "main3.py" <$> res of
49-
Right (Just (Module _ (scopeAndFrame, value))) -> do
49+
Right (Just (Module _ (scopeAndFrame, _))) -> do
5050
const () <$> SpecHelpers.lookupDeclaration "utils" scopeAndFrame heap scopeGraph `shouldBe` Just ()
5151
-- (lookupDeclaration "utils" heap >>= deNamespace heap) `shouldBe` Just ("utils", ["to_s"])
5252
other -> expectationFailure (show other)

test/Analysis/Ruby/Spec.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ spec = parallel $ do
5050
it "evaluates modules" $ do
5151
(scopeGraph, (heap, res)) <- evaluate ["modules.rb"]
5252
case ModuleTable.lookup "modules.rb" <$> res of
53-
Right (Just (Module _ (scopeAndFrame, value))) -> do
53+
Right (Just (Module _ (scopeAndFrame, _))) -> do
5454
const () <$> SpecHelpers.lookupDeclaration "Bar" scopeAndFrame heap scopeGraph `shouldBe` Just ()
5555
other -> expectationFailure (show other)
5656

test/Analysis/TypeScript/Spec.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ spec = parallel $ do
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
77-
Right (Just (Module _ (scopeAndFrame@(currentScope, currentFrame), value))) -> do
77+
Right (Just (Module _ (scopeAndFrame, value))) -> do
7878
() <$ SpecHelpers.lookupDeclaration "baz" scopeAndFrame heap scopeGraph `shouldBe` Nothing
7979
value `shouldBe` Unit
8080
Heap.heapSize heap `shouldBe` 4
@@ -87,14 +87,14 @@ spec = parallel $ do
8787
it "evaluates early return statements" $ do
8888
(scopeGraph, (heap, res)) <- evaluate ["early-return.ts"]
8989
case ModuleTable.lookup "early-return.ts" <$> res of
90-
Right (Just (Module _ (scopeAndFrame, value))) ->
90+
Right (Just (Module _ (scopeAndFrame, _))) ->
9191
const () <$> SpecHelpers.lookupDeclaration "foo" scopeAndFrame heap scopeGraph `shouldBe` Just ()
9292
other -> expectationFailure (show other)
9393

9494
it "evaluates sequence expressions" $ do
9595
(scopeGraph, (heap, res)) <- evaluate ["sequence-expression.ts"]
9696
case ModuleTable.lookup "sequence-expression.ts" <$> res of
97-
Right (Just (Module _ (scopeAndFrame, value))) ->
97+
Right (Just (Module _ (scopeAndFrame, _))) ->
9898
SpecHelpers.lookupDeclaration "x" scopeAndFrame heap scopeGraph `shouldBe` Just [ Concrete.Float (Number.Decimal (scientific 3 0)) ]
9999
other -> expectationFailure (show other)
100100

@@ -115,7 +115,7 @@ spec = parallel $ do
115115
it "evaluates await" $ do
116116
(scopeGraph, (heap, res)) <- evaluate ["await.ts"]
117117
case ModuleTable.lookup "await.ts" <$> res of
118-
Right (Just (Module _ (scopeAndFrame, value))) -> do
118+
Right (Just (Module _ (scopeAndFrame, _))) -> do
119119
-- Test that f2 is in the scopegraph and heap.
120120
const () <$> SpecHelpers.lookupDeclaration "f2" scopeAndFrame heap scopeGraph `shouldBe` Just ()
121121
-- Test we can't reference y from outside the function
@@ -159,7 +159,7 @@ spec = parallel $ do
159159
other -> expectationFailure (show other)
160160

161161
it "uniquely tracks public fields for instances" $ do
162-
(scopeGraph, (heap, res)) <- evaluate ["class1.ts", "class2.ts"]
162+
(_, (_, res)) <- evaluate ["class1.ts", "class2.ts"]
163163
case ModuleTable.lookup "class1.ts" <$> res of
164164
Right (Just (Module _ (_, value))) -> value `shouldBe` (Concrete.Float (Number.Decimal 9.0))
165165
other -> expectationFailure (show other)

test/Data/Abstract/Name/Spec.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Data.Abstract.Name.Spec where
1+
module Data.Abstract.Name.Spec (spec) where
22

33
import SpecHelpers
44

test/Data/Functor/Listable.hs

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,14 @@ import Control.Monad.Free as Free
2323
import Control.Monad.Trans.Free as FreeF
2424
import Data.Abstract.ScopeGraph (AccessControl(..))
2525
import Data.Bifunctor.Join
26-
import Data.ByteString (ByteString)
27-
import Data.Char (chr)
2826
import Data.Diff
2927
import Data.Functor.Both
3028
import qualified Data.Language as Language
3129
import Data.List.NonEmpty
3230
import Data.Patch
3331
import Data.Range
3432
import Data.Location
35-
import Data.Semigroup (Semigroup(..))
3633
import Data.Semigroup.App
37-
import Data.Source
38-
import Data.Blob
3934
import Data.Span
4035
import qualified Data.Syntax as Syntax
4136
import qualified Data.Syntax.Literal as Literal
@@ -49,7 +44,6 @@ import qualified Language.Python.Syntax as Python.Syntax
4944
import qualified Data.Abstract.Name as Name
5045
import Data.Term
5146
import Data.Text as T (Text, pack)
52-
import qualified Data.Text.Encoding as T
5347
import Data.These
5448
import Data.Sum
5549
import Diffing.Algorithm.RWS
@@ -265,28 +259,28 @@ instance Listable1 Literal.Array where
265259
liftTiers tiers = liftCons1 (liftTiers tiers) Literal.Array
266260

267261
instance Listable1 Literal.Boolean where
268-
liftTiers tiers = cons1 Literal.Boolean
262+
liftTiers _ = cons1 Literal.Boolean
269263

270264
instance Listable1 Literal.Hash where
271265
liftTiers tiers = liftCons1 (liftTiers tiers) Literal.Hash
272266

273267
instance Listable1 Literal.Float where
274-
liftTiers tiers = cons1 Literal.Float
268+
liftTiers _ = cons1 Literal.Float
275269

276270
instance Listable1 Literal.Null where
277-
liftTiers tiers = cons0 Literal.Null
271+
liftTiers _ = cons0 Literal.Null
278272

279273
instance Listable1 Literal.TextElement where
280-
liftTiers tiers = cons1 Literal.TextElement
274+
liftTiers _ = cons1 Literal.TextElement
281275

282276
instance Listable1 Literal.EscapeSequence where
283-
liftTiers tiers = cons1 Literal.EscapeSequence
277+
liftTiers _ = cons1 Literal.EscapeSequence
284278

285279
instance Listable1 Literal.InterpolationElement where
286280
liftTiers tiers = liftCons1 tiers Literal.InterpolationElement
287281

288282
instance Listable1 Literal.Character where
289-
liftTiers tiers = cons1 Literal.Character
283+
liftTiers _ = cons1 Literal.Character
290284

291285
instance Listable1 Statement.Statements where
292286
liftTiers tiers = liftCons1 (liftTiers tiers) Statement.Statements
@@ -295,10 +289,10 @@ instance Listable1 Syntax.Error where
295289
liftTiers tiers = liftCons4 mempty mempty mempty (liftTiers tiers) Syntax.Error
296290

297291
instance Listable1 Directive.File where
298-
liftTiers tiers = cons0 Directive.File
292+
liftTiers _ = cons0 Directive.File
299293

300294
instance Listable1 Directive.Line where
301-
liftTiers tiers = cons0 Directive.Line
295+
liftTiers _ = cons0 Directive.Line
302296

303297
instance Listable1 Expression.Plus where
304298
liftTiers tiers = liftCons2 tiers tiers Expression.Plus
@@ -403,19 +397,19 @@ instance Listable1 Expression.Member where
403397
liftTiers tiers = liftCons2 tiers tiers Expression.Member
404398

405399
instance Listable1 Expression.This where
406-
liftTiers tiers = cons0 Expression.This
400+
liftTiers _ = cons0 Expression.This
407401

408402
instance Listable1 Literal.Complex where
409-
liftTiers tiers = cons1 Literal.Complex
403+
liftTiers _ = cons1 Literal.Complex
410404

411405
instance Listable1 Literal.Integer where
412-
liftTiers tiers = cons1 Literal.Integer
406+
liftTiers _ = cons1 Literal.Integer
413407

414408
instance Listable1 Literal.Rational where
415-
liftTiers tiers = cons1 Literal.Rational
409+
liftTiers _ = cons1 Literal.Rational
416410

417411
instance Listable1 Literal.Regex where
418-
liftTiers tiers = cons1 Literal.Regex
412+
liftTiers _ = cons1 Literal.Regex
419413

420414
instance Listable1 Literal.String where
421415
liftTiers tiers = liftCons1 (liftTiers tiers) Literal.String
@@ -424,7 +418,7 @@ instance Listable1 Literal.Symbol where
424418
liftTiers tiers = liftCons1 (liftTiers tiers) Literal.Symbol
425419

426420
instance Listable1 Literal.SymbolElement where
427-
liftTiers tiers = cons1 Literal.SymbolElement
421+
liftTiers _ = cons1 Literal.SymbolElement
428422

429423
instance Listable1 Statement.Assignment where
430424
liftTiers tiers = liftCons3 (liftTiers tiers) tiers tiers Statement.Assignment
@@ -493,7 +487,7 @@ instance Listable1 Ruby.Syntax.Require where
493487
liftTiers tiers' = liftCons2 tiers tiers' Ruby.Syntax.Require
494488

495489
instance Listable1 Ruby.Syntax.ZSuper where
496-
liftTiers tiers = cons0 Ruby.Syntax.ZSuper
490+
liftTiers _ = cons0 Ruby.Syntax.ZSuper
497491

498492
instance Listable1 Ruby.Syntax.Send where
499493
liftTiers tiers = liftCons4 (liftTiers tiers) (liftTiers tiers) (liftTiers tiers) (liftTiers tiers) Ruby.Syntax.Send

test/Data/Graph/Spec.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{-# LANGUAGE PackageImports #-}
22

3-
module Data.Graph.Spec where
3+
module Data.Graph.Spec (spec) where
44

55
import SpecHelpers
66

test/Data/Range/Spec.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{-# LANGUAGE ScopedTypeVariables #-}
22

3-
module Data.Range.Spec where
3+
module Data.Range.Spec (spec) where
44

55
import Data.Range
66
import SpecHelpers

test/Data/Scientific/Spec.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Data.Scientific.Spec where
1+
module Data.Scientific.Spec (spec) where
22

33
import Data.Scientific.Exts
44
import Data.Either

test/Data/Semigroup/App/Spec.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Data.Semigroup.App.Spec where
1+
module Data.Semigroup.App.Spec (spec) where
22

33
import SpecHelpers
44
import Data.Semigroup.App

0 commit comments

Comments
 (0)