File tree Expand file tree Collapse file tree 3 files changed +73
-2
lines changed
Expand file tree Collapse file tree 3 files changed +73
-2
lines changed Original file line number Diff line number Diff line change 1919 <build >
2020 <finalName >${jar.finalName} </finalName >
2121 <plugins >
22+ <plugin >
23+ <groupId >org.jacoco</groupId >
24+ <artifactId >jacoco-maven-plugin</artifactId >
25+ <version >0.8.14</version >
26+ <executions >
27+ <execution >
28+ <id >default-prepare-agent</id >
29+ <goals >
30+ <goal >prepare-agent</goal >
31+ </goals >
32+ </execution >
33+ <execution >
34+ <id >default-report</id >
35+ <goals >
36+ <goal >report</goal >
37+ </goals >
38+ </execution >
39+ <execution >
40+ <id >default-check</id >
41+ <goals >
42+ <goal >check</goal >
43+ </goals >
44+ <configuration >
45+ <rules >
46+ <rule >
47+ <element >BUNDLE</element >
48+ <limits >
49+ <limit >
50+ <counter >COMPLEXITY</counter >
51+ <value >COVEREDRATIO</value >
52+ <minimum >0.60</minimum >
53+ </limit >
54+ </limits >
55+ </rule >
56+ </rules >
57+ </configuration >
58+ </execution >
59+ </executions >
60+ </plugin >
2261 <plugin >
2362 <groupId >net.revelc.code.formatter</groupId >
2463 <artifactId >formatter-maven-plugin</artifactId >
77116 </goals >
78117 <configuration >
79118 <transformers >
80- <transformer implementation =" org.apache.maven.plugins.shade.resource.ManifestResourceTransformer" >
119+ <transformer
120+ implementation=" org.apache.maven.plugins.shade.resource.ManifestResourceTransformer" >
81121 <mainClass >liquidjava.api.CommandLineLauncher</mainClass >
82122 </transformer >
83123 </transformers >
206246 </dependency >
207247 </dependencies >
208248 </dependencyManagement >
209- </project >
249+
250+ </project >
Original file line number Diff line number Diff line change 1+ import liquidjava .rj_language .ast .BinaryExpression ;
2+ import liquidjava .rj_language .ast .LiteralInt ;
3+ import liquidjava .rj_language .opt .ConstantFolding ;
4+ import liquidjava .rj_language .opt .derivation_node .ValDerivationNode ;
5+ import static org .junit .Assert .assertEquals ;
6+ import org .junit .Test ;
7+
8+ public class TestOptimization {
9+ @ Test
10+ public void testBinaryFold () {
11+ BinaryExpression b = new BinaryExpression (new LiteralInt (1 ), "+" , new LiteralInt (2 ));
12+
13+ ValDerivationNode r = ConstantFolding .fold (new ValDerivationNode (b , null ));
14+ assertEquals (r .getValue (), new LiteralInt (3 ));
15+ }
16+ }
Original file line number Diff line number Diff line change 1+ package liquidjava .rj_language ;
2+
3+ import static org .junit .Assert .assertNotEquals ;
4+ import org .junit .Test ;
5+ import liquidjava .rj_language .ast .LiteralString ;
6+
7+ public class TestLiteralString {
8+ @ Test
9+ public void testLiteralString () {
10+ LiteralString s1 = new LiteralString ("hello" );
11+ LiteralString s2 = new LiteralString ("world" );
12+ assertNotEquals (s1 .hashCode (), s2 .hashCode ());
13+ }
14+ }
You can’t perform that action at this time.
0 commit comments