Skip to content

Commit 94cd24d

Browse files
committed
Fix testing hls-graph
1 parent 3b64a3b commit 94cd24d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

hls-graph/src/Development/IDE/Graph/Internal/Types.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ renderKey :: Key -> Text
140140
renderKey (lookupKeyValue -> KeyValue _ t) = t
141141

142142
newtype KeySet = KeySet IntSet
143-
deriving (Eq, Ord, Semigroup, Monoid)
143+
deriving newtype (Eq, Ord, Semigroup, Monoid)
144144

145145
instance Show KeySet where
146146
showsPrec p (KeySet is)= showParen (p > 10) $
@@ -178,7 +178,7 @@ lengthKeySet :: KeySet -> Int
178178
lengthKeySet = coerce IS.size
179179

180180
newtype KeyMap a = KeyMap (IntMap a)
181-
deriving (Eq, Ord, Semigroup, Monoid)
181+
deriving newtype (Eq, Ord, Semigroup, Monoid)
182182

183183
instance Show a => Show (KeyMap a) where
184184
showsPrec p (KeyMap im)= showParen (p > 10) $

hls-graph/test/ActionSpec.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ spec = do
4343
pure $ do
4444
apply1 theKey
4545
res `shouldBe` [True]
46-
Just (Clean res) <- lookup (Key theKey) <$> getDatabaseValues theDb
47-
resultDeps res `shouldBe` ResultDeps [Key (Rule @())]
46+
Just (Clean res) <- lookup (newKey theKey) <$> getDatabaseValues theDb
47+
resultDeps res `shouldBe` ResultDeps (singletonKeySet $ newKey (Rule @()))
4848
it "tracks reverse dependencies" $ do
4949
db@(ShakeDatabase _ _ Database {..}) <- shakeNewDatabase shakeOptions $ do
5050
ruleUnit
@@ -54,8 +54,8 @@ spec = do
5454
pure $ do
5555
apply1 theKey
5656
res `shouldBe` [True]
57-
Just KeyDetails {..} <- atomically $ STM.lookup (Key (Rule @())) databaseValues
58-
keyReverseDeps `shouldBe` HashSet.fromList [Key theKey]
57+
Just KeyDetails {..} <- atomically $ STM.lookup (newKey (Rule @())) databaseValues
58+
keyReverseDeps `shouldBe` (singletonKeySet $ newKey theKey)
5959
it "rethrows exceptions" $ do
6060
db <- shakeNewDatabase shakeOptions $ do
6161
addRule $ \(Rule :: Rule ()) old mode -> error "boom"
@@ -74,5 +74,5 @@ spec = do
7474
pure $ do
7575
applyWithoutDependency [theKey]
7676
res `shouldBe` [[True]]
77-
Just (Clean res) <- lookup (Key theKey) <$> getDatabaseValues theDb
77+
Just (Clean res) <- lookup (newKey theKey) <$> getDatabaseValues theDb
7878
resultDeps res `shouldBe` UnknownDeps

0 commit comments

Comments
 (0)