Skip to content

Commit c8dabe2

Browse files
Merge pull request #1105 from romainbrenguier/feature/string-format
Adding support for String.format function
2 parents 657ca67 + ceb8ab7 commit c8dabe2

24 files changed

+929
-26
lines changed
Binary file not shown.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
test.class
3+
--refine-strings --string-max-length 20
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^\[.*assertion.1\].* line 6.* SUCCESS$
7+
^\[.*assertion.2\].* line 7.* FAILURE$
8+
--
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
public class test
2+
{
3+
public static String main()
4+
{
5+
String s = String.format("foo %s", "bar");
6+
assert(s.equals("foo bar"));
7+
assert(!s.equals("foo bar"));
8+
return s;
9+
}
10+
}
Binary file not shown.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
test.class
3+
--refine-strings --string-max-length 20
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^\[.*assertion.1\].* line 6.* SUCCESS$
7+
^\[.*assertion.2\].* line 7.* FAILURE$
8+
--
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
public class test
2+
{
3+
public static String main(String str)
4+
{
5+
String s = String.format("foo %s", str);
6+
assert(s.equals("foo ".concat(str)));
7+
assert(!s.equals("foo ".concat(str)));
8+
return s;
9+
}
10+
}
Binary file not shown.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
test.class
3+
--refine-strings --string-max-length 20
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^\[.*assertion.1\].* line 7.* SUCCESS$
7+
^\[.*assertion.2\].* line 9.* FAILURE$
8+
--
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
public class test
2+
{
3+
public static String main(int i)
4+
{
5+
String s = String.format("%3$sar", "a", "r", "b");
6+
if(i==0)
7+
assert(s.equals("bar"));
8+
else
9+
assert(!s.equals("bar"));
10+
return s;
11+
}
12+
}
Binary file not shown.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
KNOWNBUG
2+
test.class
3+
--refine-strings --string-max-length 20
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^\[.*assertion.1\].* line 8.* SUCCESS$
7+
^\[.*assertion.2\].* line 13.* FAILURE$
8+
--
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
public class test
2+
{
3+
public static String main(String str)
4+
{
5+
try
6+
{
7+
String s = String.format("%s %s", "a");
8+
assert(false);
9+
return s;
10+
}
11+
catch(java.util.IllegalFormatException e)
12+
{
13+
assert(false);
14+
return str;
15+
}
16+
}
17+
}
Binary file not shown.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
THOROUGH
2+
test.class
3+
--refine-strings --string-max-length 20
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^\[.*assertion.1\].* line 7.* SUCCESS$
7+
^\[.*assertion.2\].* line 9.* FAILURE$
8+
--
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
public class test
2+
{
3+
public static String main(boolean b)
4+
{
5+
String s = String.format("%s%s%s%s%s%s%s%s", "a", "b", "c", "d", "e", "f", "g", "h");
6+
if(b)
7+
assert(s.equals("abcdefgh"));
8+
else
9+
assert(!s.equals("abcdefgh"));
10+
return s;
11+
}
12+
}

0 commit comments

Comments
 (0)