|
1 | 1 | export const examples = { |
2 | | - positive: `import liquidjava.specification.Refinement; |
| 2 | + positive: `import liquidjava.specification.*; |
3 | 3 |
|
4 | 4 | class Example { |
5 | 5 | void positiveNumbers() { |
6 | 6 | @Refinement("_ > 0") |
7 | | - int count = 5; |
8 | | -
|
9 | | - // try changing 5 to -1 |
| 7 | + int count = -1; |
10 | 8 | } |
11 | 9 | } |
12 | 10 | `, |
13 | | - bounds: `import liquidjava.specification.Refinement; |
| 11 | + bounds: `import liquidjava.specification.*; |
14 | 12 |
|
15 | 13 | class Example { |
16 | 14 | void setPercentage(@Refinement("_ >= 0 && _ <= 100") int percentage) {} |
17 | 15 |
|
18 | 16 | void demo() { |
19 | | - setPercentage(75); |
20 | | - // try changing 75 to 150 |
| 17 | + setPercentage(125); |
21 | 18 | } |
22 | 19 | } |
23 | 20 | `, |
24 | | - alias: `import liquidjava.specification.Refinement; |
25 | | -import liquidjava.specification.RefinementAlias; |
| 21 | + alias: `import liquidjava.specification.*; |
26 | 22 |
|
27 | 23 | @RefinementAlias("Positive(int x) { x > 0 }") |
28 | 24 | class Example { |
29 | 25 | void demo() { |
30 | 26 | @Refinement("Positive(_)") |
31 | | - int amount = 10; |
32 | | - // try changing 10 to 0 |
| 27 | + int amount = 0; |
33 | 28 | } |
34 | 29 | } |
35 | 30 | `, |
36 | | - state: `import liquidjava.specification.StateSet; |
37 | | -import liquidjava.specification.StateRefinement; |
| 31 | + state: `import liquidjava.specification.*; |
38 | 32 |
|
39 | 33 | @StateSet({"open", "closed"}) |
40 | 34 | class Example { |
41 | | - @StateRefinement(to = "open(this)") |
| 35 | + @StateRefinement(to="open(this)") |
42 | 36 | Example() {} |
43 | 37 |
|
44 | | - @StateRefinement(from = "open(this)", to = "closed(this)") |
| 38 | + @StateRefinement(from="open(this)", to="closed(this)") |
45 | 39 | void close() {} |
46 | 40 |
|
47 | | - @StateRefinement(from = "open(this)") |
| 41 | + @StateRefinement(from="open(this)") |
48 | 42 | void read() {} |
49 | 43 |
|
50 | 44 | static void demo() { |
51 | 45 | Example resource = new Example(); |
52 | | - resource.read(); |
53 | 46 | resource.close(); |
54 | | - // try adding resource.read() after close() |
| 47 | + resource.read(); |
55 | 48 | } |
56 | 49 | } |
57 | 50 | ` |
|
0 commit comments