Skip to content

Add regression test for #420 #422

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions tests/Regressions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module Regressions (tests) where

import Control.Exception (evaluate)
import Control.Monad (replicateM)
import Data.Bits (shiftL)
import Data.Hashable (Hashable (..))
import Data.List (delete)
import Data.Maybe (isJust, isNothing)
Expand All @@ -24,6 +25,7 @@ import Test.Tasty.QuickCheck (testProperty)

import qualified Data.HashMap.Lazy as HML
import qualified Data.HashMap.Strict as HMS
import qualified Data.HashSet as HS

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

#endif

------------------------------------------------------------------------
-- Issue #420

issue420 :: Assertion
issue420 = do
let k1 :: Int = 1 `shiftL` 10
let k2 :: Int = 2 `shiftL` 10
let s0 = HS.fromList [k1, k2]
let s1 = s0 `HS.intersection` s0
assert $ k1 `HS.member` s1
assert $ k2 `HS.member` s1

------------------------------------------------------------------------
-- * Test list

Expand Down Expand Up @@ -277,4 +291,5 @@ tests = testGroup "Regression tests"
#ifdef HAVE_NOTHUNKS
, testCase "issue383" issue383
#endif
, testCase "issue420" issue420
]