Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
text
Commits
d23b29a7
Commit
d23b29a7
authored
Jul 12, 2021
by
Bodigrim
Browse files
Bring instance Arbitrary NewlineMode in line with QuickCheck HEAD
parent
5ac76ab3
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/Tests/QuickCheckUtils.hs
View file @
d23b29a7
...
...
@@ -299,16 +299,11 @@ instance Arbitrary Encoding where
,
E
"32le"
IO
.
utf32le
,
E
"32be"
IO
.
utf32be
]
windowsNewlineMode
::
IO
.
NewlineMode
windowsNewlineMode
=
IO
.
NewlineMode
{
IO
.
inputNL
=
IO
.
CRLF
,
IO
.
outputNL
=
IO
.
CRLF
}
instance
Arbitrary
IO
.
Newline
where
arbitrary
=
oneof
[
return
IO
.
LF
,
return
IO
.
CRLF
]
instance
Arbitrary
IO
.
NewlineMode
where
arbitrary
=
oneof
.
map
return
$
[
IO
.
noNewlineTranslation
,
IO
.
universalNewlineMode
,
IO
.
nativeNewlineMode
,
windowsNewlineMode
]
arbitrary
=
IO
.
NewlineMode
<$>
arbitrary
<*>
arbitrary
instance
Arbitrary
IO
.
BufferMode
where
arbitrary
=
oneof
[
return
IO
.
NoBuffering
,
...
...
@@ -339,6 +334,7 @@ write_read :: (NFData a, Eq a, Show a)
->
IO
.
BufferMode
->
[
a
]
->
Property
write_read
_
_
_
_
_
(
IO
.
NewlineMode
IO
.
LF
IO
.
CRLF
)
_
_
=
discard
write_read
unline
filt
writer
reader
(
E
_
_
)
nl
buf
ts
=
ioProperty
$
(
===
t
)
<$>
act
where
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment