Skip to content

Commit 664f021

Browse files
committed
test to show to_predicate doesn't need to take a symbol
1 parent e6f5ffa commit 664f021

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

unit/analyses/variable-sensitivity/constant_abstract_value/to_predicate.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,17 @@ SCENARIO(
4949
auto obj = make_constant(val2, environment, ns);
5050
THEN_PREDICATE(obj, "x == 2");
5151
}
52+
WHEN("(1 + 2) = 3")
53+
{
54+
auto val1 = from_integer(1, type);
55+
auto c3 = make_constant(from_integer(3, type), environment, ns);
56+
57+
auto pred = c3->to_predicate(plus_exprt(val1, val2));
58+
THEN("predicate is (1 + 2) = 3")
59+
{
60+
auto repr = expr_to_str(pred);
61+
REQUIRE(repr == "1 + 2 == 3");
62+
}
63+
}
5264
}
5365
}

0 commit comments

Comments
 (0)