File: fix-tests-32-bit

package info (click to toggle)
haskell-persistent 2.14.6.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,120 kB
  • sloc: haskell: 12,767; makefile: 3
file content (26 lines) | stat: -rw-r--r-- 1,051 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Inspired by: https://github.com/yesodweb/persistent/pull/1429

Index: b/test/Database/Persist/THSpec.hs
===================================================================
--- a/test/Database/Persist/THSpec.hs
+++ b/test/Database/Persist/THSpec.hs
@@ -26,6 +26,7 @@ module Database.Persist.THSpec where
 
 import Control.Applicative (Const(..))
 import Data.Aeson (decode, encode)
+import Data.Bits (bitSizeMaybe)
 import Data.ByteString.Lazy.Char8 ()
 import Data.Coerce
 import Data.Functor.Identity (Identity(..))
@@ -264,7 +265,10 @@ spec = describe "THSpec" $ do
         it "should have usual haskell name" $ do
             fieldHaskell `shouldBe` FieldNameHS "Id"
         it "should have correct underlying sql type" $ do
-            fieldSqlType `shouldBe` SqlInt64
+            fieldSqlType `shouldBe`
+                if bitSizeMaybe (0 :: Int) <= Just 32
+                    then SqlInt32
+                    else SqlInt64
         it "should have correct haskell type" $ do
             fieldType `shouldBe` FTTypeCon Nothing "Int"