| 1 | https://sources.debian.org/data/main/h/haskell-persistent/2.13.3.5-2/debian/patches/fix-tests-32-bit
|
| 2 | Inspired by: https://github.com/yesodweb/persistent/pull/1429
|
| 3 |
|
| 4 | |
| 5 | |
| 6 | @@ -25,6 +25,7 @@ module Database.Persist.THSpec where
|
| 7 |
|
| 8 | import Control.Applicative (Const(..))
|
| 9 | import Data.Aeson (decode, encode)
|
| 10 | +import Data.Bits (bitSizeMaybe)
|
| 11 | import Data.ByteString.Lazy.Char8 ()
|
| 12 | import Data.Coerce
|
| 13 | import Data.Functor.Identity (Identity(..))
|
| 14 | @@ -237,7 +238,10 @@ spec = describe "THSpec" $ do
|
| 15 | it "should have usual haskell name" $ do
|
| 16 | fieldHaskell `shouldBe` FieldNameHS "Id"
|
| 17 | it "should have correct underlying sql type" $ do
|
| 18 | - fieldSqlType `shouldBe` SqlInt64
|
| 19 | + fieldSqlType `shouldBe`
|
| 20 | + if bitSizeMaybe (0 :: Int) <= Just 32
|
| 21 | + then SqlInt32
|
| 22 | + else SqlInt64
|
| 23 | it "should have correct haskell type" $ do
|
| 24 | fieldType `shouldBe` FTTypeCon Nothing "Int"
|
| 25 |
|