Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions changelog.d/20260921_153711_teofilcamarasu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Fixed

- Avoid generating NULL characters in the test suite as postgres doesn't accept these.
7 changes: 6 additions & 1 deletion rel8/tests/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ testDBType getTestDatabase = testGroup "DBType instances"
[ dbTypeTest "Bool" Gen.bool
, dbTypeTest "ByteString" $ Gen.bytes (Range.linear 0 128)
, dbTypeTest "CalendarDiffTime" genCalendarDiffTime
, dbTypeTest "Char" Gen.unicode
, dbTypeTest "Char" genChar
, dbTypeTest "CI Lazy Text" $ mk . Data.Text.Lazy.fromStrict <$> genText
, dbTypeTest "CI Text" $ mk <$> genText
, dbTypeTest "Composite" genComposite
Expand Down Expand Up @@ -672,6 +672,11 @@ testDBType getTestDatabase = testGroup "DBType instances"
Rel8.many . Rel8.many . Rel8.many . (Rel8.catListTable >=> Rel8.catListTable >=> Rel8.catListTable)
diff res''' (==) [[[x, y]]]

genChar :: Gen Char
genChar =
-- Filter out NULL as that isn't accepted by Postgres
Gen.filter (/= '\0') Gen.unicode

genScientific :: Gen Scientific
genScientific = (/ 10) . fromIntegral @Int @Scientific <$> Gen.integral (Range.linear (-100) 100)

Expand Down
Loading