Adapt to new platform

parent 3f2db21c
Pipeline #12585 failed with stage
in 32 seconds
......@@ -27,9 +27,16 @@ import Testing.TestEvents
from Text import <+, class Text(join,replaceSubString,split,trim), instance Text String
import Text.GenJSON
import Text.GenParse
import Text.GenPrint
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
(ExprInt a, ExprInt b) -> gDiff{|*|} a b
......@@ -63,13 +70,13 @@ gDiff{|Expr|} x y = case (x,y) of
parentStatus :: [Diff] -> DiffStatus
parentStatus diffs = if (all (\d -> d.status == Common) field_diffs) Common Changed
_ -> simple x y
where
simple :: Expr Expr -> [Diff]
simple left right =
[ {status=OnlyLeft, value=toString left, children=[]}
, {status=OnlyRight, value=toString right, children=[]}
]
_ -> simpleDiff (toString x) (toString y)
simpleDiff :: !String !String -> [Diff]
simpleDiff left right =
[ {status=OnlyLeft, value=left, children=[]}
, {status=OnlyRight, value=right, children=[]}
]
:: *ProcessOutput =
{ lines :: ![String]
......@@ -389,7 +396,7 @@ where
where
printFA :: FailedAssertion -> String
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
printCE :: CounterExample -> String
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment