Skip to content

Commit 2754337

Browse files
committed
Updated tests to fit with main changes
1 parent 2e46e5c commit 2754337

4 files changed

Lines changed: 13 additions & 16 deletions

File tree

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1-
// Refinement Error
21
package testSuite;
32

43
import liquidjava.specification.Refinement;
54

65
@SuppressWarnings("unused")
76
class ErrorEnumFunctionRefinement {
8-
enum Color { Red, Green, Blue }
7+
enum Color {
8+
Red, Green, Blue
9+
}
910

1011
Color c;
1112

1213
Color changeColor(@Refinement("newColor == Color.Red || newColor == Color.Green") Color newColor) {
13-
c = newColor; // correct
14+
c = newColor;
1415
return c;
1516
}
16-
17+
1718
public static void main(String[] args) {
1819
ErrorEnumFunctionRefinement e = new ErrorEnumFunctionRefinement();
19-
e.changeColor(Color.Red); // correct
20-
e.changeColor(Color.Blue); // error
20+
e.changeColor(Color.Red);
21+
e.changeColor(Color.Blue); // Refinement Error
2122
}
2223
}

liquidjava-example/src/main/java/testSuite/ErrorEnumNegation.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Refinement Error
21
package testSuite;
32

43
import liquidjava.specification.Refinement;
@@ -13,7 +12,7 @@ void process(@Refinement("status != Status.Inactive") Status status) {}
1312

1413
public static void main(String[] args) {
1514
ErrorEnumNegation e = new ErrorEnumNegation();
16-
e.process(Status.Active); // correct
17-
e.process(Status.Inactive); // error
15+
e.process(Status.Active);
16+
e.process(Status.Inactive); // Refinement Error
1817
}
1918
}
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Refinement Error
21
package testSuite;
32

43
import liquidjava.specification.Refinement;
@@ -8,9 +7,9 @@ class ErrorEnumNull {
87
enum Color {
98
Red, Green, Blue
109
}
11-
10+
1211
public static void main(String[] args) {
1312
@Refinement("c == Color.Red || c == Color.Green")
14-
Color c = null; // error
13+
Color c = null; // Refinement Error
1514
}
1615
}

liquidjava-example/src/main/java/testSuite/ErrorEnumUsage.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
// State Refinement Error
21
package testSuite;
32

43
import liquidjava.specification.StateRefinement;
54
import liquidjava.specification.StateSet;
65

7-
86
@SuppressWarnings("unused")
97
@StateSet({"photoMode", "videoMode", "noMode"})
108
class ErrorEnumUsage {
@@ -21,7 +19,7 @@ public ErrorEnumUsage() {}
2119
public void setMode(Mode mode) {
2220
this.mode = mode;
2321
}
24-
22+
2523
@StateRefinement(from="photoMode(this)")
2624
public void takePhoto() {}
2725

@@ -30,6 +28,6 @@ public static void main(String[] args) {
3028
// Correct
3129
ErrorEnumUsage st = new ErrorEnumUsage();
3230
st.setMode(Mode.Video);
33-
st.takePhoto(); //error
31+
st.takePhoto(); // State Refinement Error
3432
}
3533
}

0 commit comments

Comments
 (0)