Skip to content

Commit 5553652

Browse files
Improving the test for Java case functions
We make it more precise by having some assertion that should hold and some that should fail. We also test some non ascii (but in latin-1 supplement) characters.
1 parent 6a156a9 commit 5553652

File tree

3 files changed

+31
-11
lines changed

3 files changed

+31
-11
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
CORE
22
test_case.class
33
--refine-strings
4-
^EXIT=0$
4+
^EXIT=10$
55
^SIGNAL=0$
6-
^VERIFICATION SUCCESSFUL$
6+
assertion.* file test_case.java line 10 .* SUCCESS$
7+
assertion.* file test_case.java line 11 .* SUCCESS$
8+
assertion.* file test_case.java line 12 .* SUCCESS$
9+
assertion.* file test_case.java line 16 .* FAILURE$
10+
assertion.* file test_case.java line 20 .* SUCCESS$
11+
assertion.* file test_case.java line 24 .* FAILURE$
712
--
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
11
public class test_case
22
{
3-
public static void main(/*String[] argv*/)
4-
{
5-
String s = new String("Ab");
6-
String l = s.toLowerCase();
7-
String u = s.toUpperCase();
8-
assert(l.equals("ab"));
9-
assert(u.equals("AB"));
10-
assert(s.equalsIgnoreCase("aB"));
11-
}
3+
public static void main(int i)
4+
{
5+
String s = new String("Ab");
6+
String l = s.toLowerCase();
7+
String u = s.toUpperCase();
8+
if(i==1)
9+
{
10+
assert(l.equals("ab"));
11+
assert(u.equals("AB"));
12+
assert(s.equalsIgnoreCase("aB"));
13+
}
14+
else if(i==2)
15+
{
16+
assert(!u.equals("AB"));
17+
}
18+
else if(i==3)
19+
{
20+
assert("ÖÇ".toLowerCase().equals("öç"));
21+
}
22+
else
23+
{
24+
assert(!"ÖÇ".toLowerCase().equals("öç"));
25+
}
26+
}
1227
}

0 commit comments

Comments
 (0)