Added regression tests based on originating test-gen tests

The relevant tests implemented in diffblue/test-gen/pull/479 (StringContains3 and StringContains4) for test-gen have been adapted and added as StringContains01 and StringContains02 resp. They have been marked as future in accordance to the standard for other tests. A contains smoke test already exists and is active, which was extended.
This commit is contained in:
Jesse Sigal 2017-07-03 11:44:12 +01:00
parent 8495451a9f
commit 939fb87662
9 changed files with 38 additions and 4 deletions

View File

@ -1,8 +1,12 @@
CORE
test_contains.class
--refine-strings
^EXIT=0$
^EXIT=10$
^SIGNAL=0$
^\[.*assertion.1\].* line 8.* SUCCESS$
^\[.*assertion.2\].* line 9.* SUCCESS$
^\[.*assertion.3\].* line 12.* FAILURE$
^\[.*assertion.4\].* line 13.* FAILURE$
^VERIFICATION FAILED$
--
Issue: diffblue/test-gen#201

View File

@ -1,12 +1,15 @@
public class test_contains
{
public static void main(/*String[] argv*/)
public static void main(String x)
{
String s = new String("Abc");
String u = "bc";
String t = "ab";
assert(s.contains(u));
// Long version:
// assert(s.contains(t));
assert(!s.contains(t));
String z = new String(x);
if (z.length() > 3) assert(t.contains(z));
else assert(z.contains(u));
}
}

Binary file not shown.

View File

@ -0,0 +1,6 @@
FUTURE
test.class
--refine-strings
^EXIT=10$
^SIGNAL=0$
^VERIFICATION FAILED$

View File

@ -0,0 +1,8 @@
public class test
{
public static void main(String s)
{
String ab = "abc";
assert(ab.contains(s));
}
}

Binary file not shown.

View File

@ -0,0 +1,6 @@
FUTURE
test.class
--refine-strings
^EXIT=10$
^SIGNAL=0$
^VERIFICATION FAILED$

View File

@ -0,0 +1,7 @@
public class test
{
public static void main(String s)
{
assert(s.contains("Hello"));
}
}