File tree 3 files changed +36
-11
lines changed
regression/strings-smoke-tests/java_append_string
3 files changed +36
-11
lines changed Original file line number Diff line number Diff line change 1
1
public class test_append_string
2
2
{
3
- public static void main (/*String[] args*/ )
4
- {
5
- String di = new String ("di" );
6
- StringBuilder diff = new StringBuilder ();
7
- diff .append (di );
8
- diff .append ("ff" );
9
- System .out .println (diff );
10
- String s = diff .toString ();
11
- System .out .println (s );
12
- assert s .equals ("diff" );
13
- }
3
+ public static void main ()
4
+ {
5
+ String di = new String ("di" );
6
+ StringBuilder diff = new StringBuilder ();
7
+ diff .append (di );
8
+ diff .append ("ff" );
9
+ System .out .println (diff );
10
+ String s = diff .toString ();
11
+ System .out .println (s );
12
+ assert s .equals ("diff" );
13
+ }
14
+
15
+ public static void check (StringBuilder sb , String str )
16
+ {
17
+ String init = sb .toString ();
18
+ if (str .length () >= 4 )
19
+ {
20
+ sb .append (str , 2 , 4 );
21
+ String res = sb .toString ();
22
+ assert (res .startsWith (init ));
23
+ assert (res .endsWith (str .substring (2 , 4 )));
24
+ assert (res .length () == init .length () + 2 );
25
+ assert (!res .equals ("foobarfuz" ));
26
+ }
27
+ }
28
+
14
29
}
Original file line number Diff line number Diff line change
1
+ CORE
2
+ test_append_string.class
3
+ --refine-strings --string-max-length 10 --function test_append_string.check --java-assume-inputs-non-null
4
+ ^EXIT=10$
5
+ ^SIGNAL=0$
6
+ ^\[.*assertion.*\].* line 22.* SUCCESS$
7
+ ^\[.*assertion.*\].* line 23.* SUCCESS$
8
+ ^\[.*assertion.*\].* line 24.* SUCCESS$
9
+ ^\[.*assertion.*\].* line 25.* FAILURE$
10
+ --
You can’t perform that action at this time.
0 commit comments