unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob d0aace2445946dd2b1d5008dc2aa4b573a06d8c7 1043 bytes (raw)
name: packages/patches/ghc-persistent-fix-32bit.patch 	 # note: path name is non-authoritative(*)

 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
 
https://sources.debian.org/data/main/h/haskell-persistent/2.13.3.5-2/debian/patches/fix-tests-32-bit
Inspired by: https://github.com/yesodweb/persistent/pull/1429

--- a/test/Database/Persist/THSpec.hs
+++ b/test/Database/Persist/THSpec.hs
@@ -25,6 +25,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(..))
@@ -237,7 +238,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"
 

debug log:

solving d0aace2445946dd2b1d5008dc2aa4b573a06d8c7 ...
found d0aace2445946dd2b1d5008dc2aa4b573a06d8c7 in https://git.savannah.gnu.org/cgit/guix.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).