Newer
Older
import Data.List (elemIndex)
import Data.List.Split (splitOn)
import System.IO (stderr, stdout)
import System.IO.Silently (hSilence)
import System.IO.Unsafe (unsafePerformIO)
import Javawlp.Engine.HelperFunctions (parseMethodIds)
testEquiv :: Response -> String -> String -> String -> Assertion
testEquiv b src s s' = do
res <- hSilence [stdout, stderr] $ compareSpec Debug File (src, s) (src, s')
(case res of
NotEquivalent _ _ -> NotEquivalent emptyModel defFeedback'
(.!=) = testEquiv $ NotEquivalent emptyModel defFeedback'
let methodIds = unsafePerformIO (hSilence [stdout, stderr] $ parseMethodIds edslSrc)
tailFrom :: Eq a => [a] -> a -> [a]
tailFrom xs x = case elemIndex x xs of Just i -> snd $ splitAt i xs
Nothing -> []
putStrLn $ " (" ++ a ++ testOpS ++ b ++ ")"
return $ testOp edslSrc
where [clA, clB] = getClass <$> [a, b]
eq = clA == clB
(testOp, testOpS) =
if eq then ((.==), " == ") else ((.!=), " != ")