Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Software
CoPaR
Commits
229e6bf1
Commit
229e6bf1
authored
Nov 13, 2020
by
Hans-Peter Deifel
🐢
Browse files
Fix whitespace
parent
c7fc3340
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/Examples.hs
View file @
229e6bf1
...
...
@@ -86,13 +86,13 @@ testFileMinimize mini =
process
file
`
shouldReturn
`
minimized
where
process
::
FilePath
->
IO
String
process
file
=
P
.
readFile
P
.
defaultConfig
file
>>=
process
file
=
P
.
readFile
P
.
defaultConfig
file
>>=
\
case
Left
err
->
return
err
Right
(
f
,
(
symTab
,
enc
))
->
do
part
<-
stToIO
(
refine
(
Proxy
::
Proxy
(
Desorted
SomeFunctor
))
enc
True
)
let
let
(
enc'
,
symTab'
)
=
minimize
f
enc
symTab
part
return
(
LT
.
unpack
.
Build
.
toLazyText
$
Build
.
fromText
(
printParseableFunctor
f
)
...
...
@@ -103,18 +103,18 @@ testFileMinimize mini =
testFileMinimizeIdentity
::
FilePath
->
Spec
testFileMinimizeIdentity
file
=
specify
(
"minimizeIdentity "
<>
file
)
$
do
P
.
readFile
P
.
defaultConfig
file
>>=
P
.
readFile
P
.
defaultConfig
file
>>=
\
case
Left
err
->
expectationFailure
$
"initialParse: "
<>
err
Right
(
f
,
(
symTab
,
enc
))
->
do
part
<-
stToIO
(
refine
(
Proxy
::
Proxy
(
Desorted
SomeFunctor
))
enc
True
)
let
let
(
enc'
,
symTab'
)
=
minimize
f
enc
symTab
part
coalgebra
=
Build
.
fromText
(
printParseableFunctor
f
)
coalgebra
=
Build
.
fromText
(
printParseableFunctor
f
)
<>
"
\n\n
"
<>
printEncoding
enc'
(
anonymizeSymbols
symTab'
)
(
sortTable
f
)
reparsed
=
P
.
parseCoalgebra
P
.
defaultConfig
"(minimized)"
$
LT
.
toStrict
(
Build
.
toLazyText
coalgebra
)
case
reparsed
of
Left
err
->
expectationFailure
$
"parseMinimized: "
<>
err
...
...
@@ -123,7 +123,7 @@ testFileMinimizeIdentity file =
let
(
enc'''
,
symTab'''
)
=
minimize
f'
enc''
symTab''
part'
Build
.
fromText
(
printParseableFunctor
f
)
Build
.
fromText
(
printParseableFunctor
f
)
<>
"
\n\n
"
<>
(
printEncoding
enc'''
(
anonymizeSymbols
symTab'''
)
(
sortTable
f'
))
`
shouldBe
`
<>
(
printEncoding
enc'''
(
anonymizeSymbols
symTab'''
)
(
sortTable
f'
))
`
shouldBe
`
coalgebra
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