I got this test failure in one of my own projects that uses persistent-sqlite:
- expected: "h\910325\NULL\1073793\562934"
but got: "h\910325"
Given that something goes wrong with a null byte, I figured that there was probably something involving C code going wrong.
The tests in persistent:test:test don't test for text values with nulls:
|
arbText :: Gen Text |
|
arbText = |
|
T.pack |
|
. filter ((`notElem` forbidden) . generalCategory) |
|
. filter (<= '\xFFFF') -- only BMP |
|
. filter (/= '\0') -- no nulls |
|
. T.unpack |
|
<$> arbitrary |
|
where forbidden = [NotAssigned, PrivateUse] |
This was supposedly fixed in #310 but when
but when I comment out that line (line 192 in persistent-test/src/Init.hs), I get this test failure in persistent-sqlite:test:test:
expected: ("text","@\NUL7")
but got: ("text","@")
While fixing this problem, would it be possible to also remove the other filters for arbText:
before:
arbText :: Gen Text
arbText =
T.pack
. filter ((`notElem` forbidden) . generalCategory)
. filter (<= '\xFFFF') -- only BMP
. filter (/= '\0') -- no nulls
. T.unpack
<$> arbitrary
where forbidden = [NotAssigned, PrivateUse]
after:
arbText :: Gen Text
arbText = arbitrary
I got this test failure in one of my own projects that uses
persistent-sqlite:Given that something goes wrong with a null byte, I figured that there was probably something involving C code going wrong.
The tests in
persistent:test:testdon't test for text values with nulls:persistent/persistent-test/src/Init.hs
Lines 187 to 195 in a3eed2f
This was supposedly fixed in #310 but when
but when I comment out that line (line 192 in
persistent-test/src/Init.hs), I get this test failure inpersistent-sqlite:test:test:While fixing this problem, would it be possible to also remove the other filters for
arbText:before:
after: