File tree Expand file tree Collapse file tree 4 files changed +77
-2
lines changed
Expand file tree Collapse file tree 4 files changed +77
-2
lines changed Original file line number Diff line number Diff line change 7777 </goals >
7878 <configuration >
7979 <transformers >
80- <transformer implementation =" org.apache.maven.plugins.shade.resource.ManifestResourceTransformer" >
80+ <transformer
81+ implementation=" org.apache.maven.plugins.shade.resource.ManifestResourceTransformer" >
8182 <mainClass >liquidjava.api.CommandLineLauncher</mainClass >
8283 </transformer >
8384 </transformers >
9596 </execution >
9697 </executions >
9798 </plugin >
99+ <plugin >
100+ <groupId >org.jacoco</groupId >
101+ <artifactId >jacoco-maven-plugin</artifactId >
102+ <version >0.8.14</version >
103+ <executions >
104+ <execution >
105+ <id >default-prepare-agent</id >
106+ <goals >
107+ <goal >prepare-agent</goal >
108+ </goals >
109+ </execution >
110+ <execution >
111+ <id >default-report</id >
112+ <goals >
113+ <goal >report</goal >
114+ </goals >
115+ </execution >
116+ <execution >
117+ <id >default-check</id >
118+ <goals >
119+ <goal >check</goal >
120+ </goals >
121+ <configuration >
122+ <rules >
123+ <rule >
124+ <element >BUNDLE</element >
125+ <limits >
126+ <limit >
127+ <counter >COMPLEXITY</counter >
128+ <value >COVEREDRATIO</value >
129+ <minimum >0.60</minimum >
130+ </limit >
131+ </limits >
132+ </rule >
133+ </rules >
134+ </configuration >
135+ </execution >
136+ </executions >
137+ </plugin >
98138 </plugins >
99139 </build >
100140
206246 </dependency >
207247 </dependencies >
208248 </dependencyManagement >
209- </project >
249+ </project >
Original file line number Diff line number Diff line change 1+
2+ import static org .junit .Assert .assertEquals ;
3+
4+ import org .junit .Test ;
5+
6+ import liquidjava .rj_language .ast .BinaryExpression ;
7+ import liquidjava .rj_language .ast .LiteralInt ;
8+ import liquidjava .rj_language .opt .ConstantFolding ;
9+ import liquidjava .rj_language .opt .derivation_node .ValDerivationNode ;
10+
11+ public class TestOptimization {
12+
13+ @ Test
14+ public void testBinaryFold () {
15+ BinaryExpression b = new BinaryExpression (new LiteralInt (1 ), "+" , new LiteralInt (2 ));
16+
17+ ValDerivationNode r = ConstantFolding .fold (new ValDerivationNode (b , null ));
18+ assertEquals (r .getValue (), new LiteralInt (3 ));
19+ }
20+ }
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+
9+ @ Test
10+ public void testLiteralString () {
11+ LiteralString s1 = new LiteralString ("hello" );
12+ LiteralString s2 = new LiteralString ("world" );
13+ assertNotEquals (s1 .hashCode (), s2 .hashCode ());
14+ }
15+ }
You can’t perform that action at this time.
0 commit comments