Skip to content

Commit 2198f25

Browse files
committed
Add regression test for #420
1 parent 4da2c20 commit 2198f25

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/Regressions.hs

+15
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module Regressions (tests) where
77

88
import Control.Exception (evaluate)
99
import Control.Monad (replicateM)
10+
import Data.Bits (shiftL)
1011
import Data.Hashable (Hashable (..))
1112
import Data.List (delete)
1213
import Data.Maybe (isJust, isNothing)
@@ -24,6 +25,7 @@ import Test.Tasty.QuickCheck (testProperty)
2425

2526
import qualified Data.HashMap.Lazy as HML
2627
import qualified Data.HashMap.Strict as HMS
28+
import qualified Data.HashSet as HS
2729

2830
#if MIN_VERSION_base(4,12,0)
2931
-- nothunks requires base >= 4.12
@@ -248,6 +250,18 @@ issue383 = do
248250

249251
#endif
250252

253+
------------------------------------------------------------------------
254+
-- Issue #420
255+
256+
issue420 :: Assertion
257+
issue420 = do
258+
let k1 :: Int = 1 `shiftL` 10
259+
let k2 :: Int = 2 `shiftL` 10
260+
let s0 = HS.fromList [k1, k2]
261+
let s1 = s0 `HS.intersection` s0
262+
assert $ k1 `HS.member` s1
263+
assert $ k2 `HS.member` s1
264+
251265
------------------------------------------------------------------------
252266
-- * Test list
253267

@@ -277,4 +291,5 @@ tests = testGroup "Regression tests"
277291
#ifdef HAVE_NOTHUNKS
278292
, testCase "issue383" issue383
279293
#endif
294+
, testCase "issue420" issue420
280295
]

0 commit comments

Comments
 (0)