From 0080584564849a8b283be6b0e95ba508f7ea337b Mon Sep 17 00:00:00 2001 From: andreiburdusa Date: Tue, 8 Sep 2020 14:50:20 +0300 Subject: [PATCH 1/3] Add test --- kore/test/Test/Kore/Builtin/Int.hs | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/kore/test/Test/Kore/Builtin/Int.hs b/kore/test/Test/Kore/Builtin/Int.hs index 1d5a38118a..94e52b5d75 100644 --- a/kore/test/Test/Kore/Builtin/Int.hs +++ b/kore/test/Test/Kore/Builtin/Int.hs @@ -33,6 +33,8 @@ module Test.Kore.Builtin.Int , testInt ) where +import qualified Data.Foldable as Foldable +import Kore.Unparser import Prelude.Kore import Hedgehog hiding @@ -587,6 +589,35 @@ test_unifyIntEq = & Condition.fromPredicate & simplifyCondition' assertEqual "" [expect { term = () }] actual + , testCase "\\equals(X +Int 1 ==Int Y +Int 1, false)" $ do + let term1 = + eqInt + (addInt (mkElemVar x) (asInternal 1)) + (addInt (mkElemVar y) (asInternal 1)) + term2 = Test.Bool.asInternal False + expect = + makeEqualsPredicate_ + (addInt (mkElemVar x) (asInternal 1)) + (addInt (mkElemVar y) (asInternal 1)) + & makeNotPredicate + & Condition.fromPredicate + & Pattern.fromCondition_ + -- unit test + do + actual <- unifyIntEq term1 term2 + assertEqual "" [Just expect] actual + -- integration test + do + actual <- + makeEqualsPredicate_ term1 term2 + & Condition.fromPredicate + & simplifyCondition' + -- traceM "expect" + -- traceM . unparseToString $ expect + -- traceM "actual" + -- Foldable.traverse_ + -- (traceM . unparseToString) actual + assertEqual "" [expect { term = () }] actual ] where x, y :: ElementVariable VariableName From 74482e9478e0e2fe67744b8d89114505a1766f5d Mon Sep 17 00:00:00 2001 From: andreiburdusa Date: Tue, 8 Sep 2020 15:24:02 +0300 Subject: [PATCH 2/3] Pedantic --- kore/test/Test/Kore/Builtin/Int.hs | 2 -- 1 file changed, 2 deletions(-) diff --git a/kore/test/Test/Kore/Builtin/Int.hs b/kore/test/Test/Kore/Builtin/Int.hs index 94e52b5d75..99dbce2cac 100644 --- a/kore/test/Test/Kore/Builtin/Int.hs +++ b/kore/test/Test/Kore/Builtin/Int.hs @@ -33,8 +33,6 @@ module Test.Kore.Builtin.Int , testInt ) where -import qualified Data.Foldable as Foldable -import Kore.Unparser import Prelude.Kore import Hedgehog hiding From befc9a5a3669aff0ec312d72babe492461728ed3 Mon Sep 17 00:00:00 2001 From: andreiburdusa Date: Tue, 8 Sep 2020 17:22:02 +0300 Subject: [PATCH 3/3] Remove comments --- kore/test/Test/Kore/Builtin/Int.hs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/kore/test/Test/Kore/Builtin/Int.hs b/kore/test/Test/Kore/Builtin/Int.hs index 99dbce2cac..8e441cdc33 100644 --- a/kore/test/Test/Kore/Builtin/Int.hs +++ b/kore/test/Test/Kore/Builtin/Int.hs @@ -610,11 +610,6 @@ test_unifyIntEq = makeEqualsPredicate_ term1 term2 & Condition.fromPredicate & simplifyCondition' - -- traceM "expect" - -- traceM . unparseToString $ expect - -- traceM "actual" - -- Foldable.traverse_ - -- (traceM . unparseToString) actual assertEqual "" [expect { term = () }] actual ] where