use of org.evosuite.symbolic.expr.bv.StringBinaryComparison in project evosuite by EvoSuite.
the class TestStringSearch method testRegexMatchesFalse.
@Test
public void testRegexMatchesFalse() {
List<Constraint<?>> constraints = new ArrayList<Constraint<?>>();
String var1 = "testsomestring";
String const2 = "testsomestring";
StringVariable strVar = new StringVariable("test1", var1);
StringConstant strConst = new StringConstant(const2);
StringBinaryComparison strComp = new StringBinaryComparison(strVar, Operator.PATTERNMATCHES, strConst, 0L);
constraints.add(new StringConstraint(strComp, Comparator.EQ, new IntegerConstant(0)));
EvoSuiteSolver skr = new EvoSuiteSolver();
Map<String, Object> result;
try {
result = solve(skr, constraints);
assertNotNull(result);
assertNotNull(result.get("test1"));
assertFalse("Result should not match TEST: " + result.get("test1").toString(), result.get("test1").toString().matches(const2));
} catch (SolverTimeoutException e) {
fail();
}
}
Aggregations