Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
clean-and-itasks
clean-test
Commits
036ec424
Verified
Commit
036ec424
authored
Jun 30, 2018
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapt to new platform
parent
3f2db21c
Pipeline
#12585
failed with stage
in 32 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
cleantest.icl
cleantest.icl
+16
-9
No files found.
cleantest.icl
View file @
036ec424
...
@@ -27,9 +27,16 @@ import Testing.TestEvents
...
@@ -27,9 +27,16 @@ import Testing.TestEvents
from
Text
import
<+,
class
Text
(
join
,
replaceSubString
,
split
,
trim
),
instance
Text
String
from
Text
import
<+,
class
Text
(
join
,
replaceSubString
,
split
,
trim
),
instance
Text
String
import
Text
.
GenJSON
import
Text
.
GenJSON
import
Text
.
GenParse
import
Text
.
GenParse
import
Text
.
GenPrint
import
Text
.
Language
import
Text
.
Language
derive
gDiff
GenConsAssoc
,
Maybe
derive
gDiff
GenConsAssoc
,
Maybe
,
JSONNode
derive
gPrint
Expression
,
JSONNode
gDiff
{|
Expression
|}
x
y
=
case
(
x
,
y
)
of
(
JSON
x
,
JSON
y
)
->
gDiff
{|*|}
x
y
(
GPrint
x
,
GPrint
y
)
->
gDiff
{|*|}
(
preParseString
x
)
(
preParseString
y
)
_
->
simpleDiff
(
printToString
x
)
(
printToString
y
)
gDiff
{|
Expr
|}
x
y
=
case
(
x
,
y
)
of
gDiff
{|
Expr
|}
x
y
=
case
(
x
,
y
)
of
(
ExprInt
a
,
ExprInt
b
)
->
gDiff
{|*|}
a
b
(
ExprInt
a
,
ExprInt
b
)
->
gDiff
{|*|}
a
b
...
@@ -63,13 +70,13 @@ gDiff{|Expr|} x y = case (x,y) of
...
@@ -63,13 +70,13 @@ gDiff{|Expr|} x y = case (x,y) of
parentStatus
::
[
Diff
]
->
DiffStatus
parentStatus
::
[
Diff
]
->
DiffStatus
parentStatus
diffs
=
if
(
all
(\
d
->
d
.
status
==
Common
)
field_diffs
)
Common
Changed
parentStatus
diffs
=
if
(
all
(\
d
->
d
.
status
==
Common
)
field_diffs
)
Common
Changed
_
->
simple
x
y
_
->
simple
Diff
(
toString
x
)
(
toString
y
)
where
simple
::
Expr
Expr
->
[
Diff
]
simple
Diff
::
!
String
!
String
->
[
Diff
]
simple
left
right
=
simple
Diff
left
right
=
[
{
status
=
OnlyLeft
,
value
=
toString
left
,
children
=[]}
[
{
status
=
OnlyLeft
,
value
=
left
,
children
=[]}
,
{
status
=
OnlyRight
,
value
=
toString
right
,
children
=[]}
,
{
status
=
OnlyRight
,
value
=
right
,
children
=[]}
]
]
::
*
ProcessOutput
=
::
*
ProcessOutput
=
{
lines
::
![
String
]
{
lines
::
![
String
]
...
@@ -389,7 +396,7 @@ where
...
@@ -389,7 +396,7 @@ where
where
where
printFA
::
FailedAssertion
->
String
printFA
::
FailedAssertion
->
String
printFA
(
ExpectedRelation
x
rel
y
)
=
"Expected "
+++
toString
rel
+++
" on:
\n
"
+++
case
rel
of
printFA
(
ExpectedRelation
x
rel
y
)
=
"Expected "
+++
toString
rel
+++
" on:
\n
"
+++
case
rel
of
Eq
->
diffToConsole
$
gDiff
{|*|}
(
preParseString
x
)
(
preParseString
y
)
Eq
->
diffToConsole
$
gDiff
{|*|}
x
y
_
->
toString
x
+++
"
\n
"
+++
toString
y
_
->
toString
x
+++
"
\n
"
+++
toString
y
printCE
::
CounterExample
->
String
printCE
::
CounterExample
->
String
...
...
Write
Preview
Markdown
is supported
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