Skip to content

Commit 1266ee0

Browse files
Test for String.contains and very large strings
This tests string refinement is able to deal with very large strings in string_not_contains_constraintt objects.
1 parent e5f35c8 commit 1266ee0

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed
779 Bytes
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
public class Test {
2+
public static String check(String s) {
3+
// Filter
4+
if (s == null) {
5+
return "Null string";
6+
}
7+
if (s.length() < 16_000_000) {
8+
return "Too short";
9+
}
10+
11+
// Act
12+
boolean b1 = s.contains("foobar");
13+
14+
// Filter output
15+
if (b1) {
16+
return "Contained";
17+
}
18+
19+
// Assert
20+
assert(false);
21+
return "Unreachable";
22+
}
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CORE
2+
Test.class
3+
--refine-strings --function Test.check
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^VERIFICATION FAILED$
7+
file Test.java line 20 .*: FAILURE$
8+
--
9+
--
10+
--string-max-length is not used on purpose, because this tests the behaviour
11+
of string refinement on very large strings.

0 commit comments

Comments
 (0)